Fix lifecycle privacy review findings

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a26cd6d6-ff49-433e-bc53-f645c455ebdd
This commit is contained in:
Jesper Schulz-Wedde 2026-07-14 12:22:02 +02:00
parent 0c2a0ceb82
commit 925beb3204
5 changed files with 12 additions and 14 deletions

View file

@ -1,13 +1,12 @@
codeunit 50308 "ErrorInfo Privacy Bad"
{
procedure RaiseSynchronizationError(Customer: Record Customer; ResponseBody: Text)
procedure RaiseSynchronizationError(Customer: Record Customer)
var
FailureInfo: ErrorInfo;
begin
FailureInfo.Message := StrSubstNo('Synchronization failed for %1.', Customer."E-Mail");
FailureInfo.DataClassification := DataClassification::SystemMetadata;
FailureInfo.ErrorType := ErrorType::Internal;
FailureInfo.DetailedMessage := ResponseBody;
Error(FailureInfo);
end;
}

View file

@ -7,11 +7,9 @@ codeunit 50307 "ErrorInfo Privacy Good"
FailureInfo.Message := SynchronizationFailedErr;
FailureInfo.DataClassification := DataClassification::SystemMetadata;
FailureInfo.ErrorType := ErrorType::Client;
FailureInfo.DetailedMessage := RetryDiagnosticsTxt;
Error(FailureInfo);
end;
var
RetryDiagnosticsTxt: Label 'The remote service rejected the request. Review the integration telemetry event.';
SynchronizationFailedErr: Label 'The synchronization could not be completed.';
}

View file

@ -1,5 +1,5 @@
---
bc-version: [19..]
bc-version: [14..]
domain: privacy
keywords: [errorinfo, message, dataclassification, errortype, detailedmessage, copy-details, telemetry]
technologies: [al]
@ -11,16 +11,16 @@ application-area: [all]
## Description
`ErrorInfo.Message` is sent to telemetry; with `ErrorType::Client` it is also the primary client message, while `ErrorType::Internal` replaces it in the client with a generic message but still sends the specified text to telemetry. `DataClassification` classifies the content in `Message`; it does not make incorrectly classified personal data safe. `DetailedMessage`, available from BC 19, is omitted from the primary message but is included in the error dialog's **Copy details** content.
`ErrorInfo.Message` is sent to telemetry; with `ErrorType::Client` it is also the primary client message, while `ErrorType::Internal` replaces it in the client with a generic message but still sends the specified text to telemetry. `DataClassification` classifies the content in `Message`; it does not make incorrectly classified personal data safe. In BC 19 and later, `DetailedMessage` is omitted from the primary message but is included in the error dialog's **Copy details** content.
## Best Practice
Keep `Message` stable and classify its actual content. Choose `ErrorType` for client usability, not as a telemetry privacy boundary. Put only support-safe technical context in `DetailedMessage`, because a user can copy it from the dialog.
Keep `Message` stable and classify its actual content. Choose `ErrorType` for client usability, not as a telemetry privacy boundary. In BC 19 and later, put only support-safe technical context in `DetailedMessage`, because a user can copy it from the dialog. The samples use only members available at the BC 14 article floor.
See sample: `errorinfo-telemetry-classification-and-errortype.good.al`.
## Anti Pattern
Marking a dynamic customer-bearing `Message` as `SystemMetadata`, assuming `ErrorType::Internal` keeps it out of telemetry, or placing secrets and personal data in `DetailedMessage` because it is not the primary dialog text.
Marking a dynamic customer-bearing `Message` as `SystemMetadata`, assuming `ErrorType::Internal` keeps it out of telemetry, or, in BC 19 and later, placing secrets and personal data in `DetailedMessage` because it is not the primary dialog text.
See sample: `errorinfo-telemetry-classification-and-errortype.bad.al`.