mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 09:26:52 +01:00
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c2eebc4-dcd5-4b85-8113-90772d818900
16 lines
499 B
AL
16 lines
499 B
AL
codeunit 50208 "Privacy Sample GetLastError Good"
|
|
{
|
|
procedure AddAttachmentSafely()
|
|
var
|
|
AttachmentFailedErr: Label 'Failed to add the attachment: %1', Comment = '%1 = underlying error shown to the user';
|
|
begin
|
|
if not TryAddAttachment() then
|
|
Error(AttachmentFailedErr, GetLastErrorText(true));
|
|
end;
|
|
|
|
[TryFunction]
|
|
local procedure TryAddAttachment()
|
|
begin
|
|
// Attachment logic that can fail with a customer-data-bearing error.
|
|
end;
|
|
}
|