diff options
Diffstat (limited to 'services/sync/modules/telemetry.sys.mjs')
-rw-r--r-- | services/sync/modules/telemetry.sys.mjs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/sync/modules/telemetry.sys.mjs b/services/sync/modules/telemetry.sys.mjs index c08f405b0e..28888ef277 100644 --- a/services/sync/modules/telemetry.sys.mjs +++ b/services/sync/modules/telemetry.sys.mjs @@ -241,10 +241,14 @@ export class ErrorSanitizer { NotAllowedError: this.E_PERMISSION_DENIED, }; + // IOUtils error messages include the specific nsresult error code that caused them. + static NS_ERROR_RE = new RegExp(/ \(NS_ERROR_.*\)$/); + static #cleanOSErrorMessage(message, error = undefined) { if (DOMException.isInstance(error)) { const sub = this.DOMErrorSubstitutions[error.name]; message = message.replaceAll("\\", "/"); + message = message.replace(this.NS_ERROR_RE, ""); if (sub) { return `${sub} ${message}`; } |