Method GuardOptionalAsync
- Namespace
- MailFathom.Application.SensitiveContent.Egress
- Assembly
- MailFathom.Application.dll
GuardOptionalAsync(SensitiveContentEgressPoint, string?, CancellationToken)
Guards a text that a message need not carry at all.
public Task<string?> GuardOptionalAsync(SensitiveContentEgressPoint egressPoint, string? text, CancellationToken cancellationToken)
Parameters
egressPointSensitiveContentEgressPointWhere the text is going.
textstringThe text to guard, or null where the message carried none.
cancellationTokenCancellationTokenCancels the scan.
Returns
Remarks
Absence is carried through rather than turned into an empty string, because a subject nobody wrote and a subject redacted to nothing are different facts and a reader acts differently on each.
Exceptions
- SensitiveContentScannerUnavailableException
Thrown when a switched-on scanner could not establish what the text carries, which refuses the egress.
- OperationCanceledException
Thrown when
cancellationTokenis cancelled.