зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1869371 - Strip NS_ERROR_* codes from submitted telemetry r=markh,sync-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D200969
This commit is contained in:
Родитель
f0e51159ae
Коммит
611413b73c
|
@ -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}`;
|
||||
}
|
||||
|
|
|
@ -734,7 +734,7 @@ add_task(async function test_clean_real_os_error() {
|
|||
equal(failureReason.name, "unexpectederror");
|
||||
equal(
|
||||
failureReason.error,
|
||||
"OS error [File/Path not found] Could not open the file at [profileDir]/no/such/path.json"
|
||||
"OS error [File/Path not found] Could not open `[profileDir]/no/such/path.json': file does not exist"
|
||||
);
|
||||
});
|
||||
} finally {
|
||||
|
|
Загрузка…
Ссылка в новой задаче