mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1919785 - [devtools] Improve error logging when an exception is thrown in devtools workers. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D222790
This commit is contained in:
parent
0b0d5e673d
commit
5ddce9f95d
@ -41394,7 +41394,9 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
|
||||
// string.
|
||||
return {
|
||||
error: true,
|
||||
message: error.message,
|
||||
message:
|
||||
error.message +
|
||||
(error.stack ? "\nStack in the worker:" + error.stack : ""),
|
||||
metadata: error.metadata,
|
||||
};
|
||||
}
|
||||
|
@ -3712,7 +3712,9 @@
|
||||
// string.
|
||||
return {
|
||||
error: true,
|
||||
message: error.message,
|
||||
message:
|
||||
error.message +
|
||||
(error.stack ? "\nStack in the worker:" + error.stack : ""),
|
||||
metadata: error.metadata,
|
||||
};
|
||||
}
|
||||
|
@ -372,7 +372,9 @@
|
||||
// string.
|
||||
return {
|
||||
error: true,
|
||||
message: error.message,
|
||||
message:
|
||||
error.message +
|
||||
(error.stack ? "\nStack in the worker:" + error.stack : ""),
|
||||
metadata: error.metadata,
|
||||
};
|
||||
}
|
||||
|
@ -158,6 +158,18 @@ add_task(async function testBaseURLErrorHandling() {
|
||||
await gSourceMapLoader.getOriginalURLs(source);
|
||||
ok(false, "Should throw");
|
||||
} catch (e) {
|
||||
is(e.message, "URL constructor: http:://example.com/ is not a valid URL.");
|
||||
// We have to use startsWith as the rest of the message will be the stack trace in the worker thread
|
||||
ok(
|
||||
e.message.startsWith(
|
||||
"URL constructor: http:://example.com/ is not a valid URL."
|
||||
),
|
||||
"the worker thrown with the right error message"
|
||||
);
|
||||
ok(
|
||||
e.message.includes(
|
||||
"getOriginalURLs@resource://devtools/client/shared/source-map-loader/source-map.js"
|
||||
),
|
||||
"Found at least one frame of the stack"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -136,7 +136,9 @@ function asErrorMessage(error) {
|
||||
// string.
|
||||
return {
|
||||
error: true,
|
||||
message: error.message,
|
||||
message:
|
||||
error.message +
|
||||
(error.stack ? "\nStack in the worker:" + error.stack : ""),
|
||||
metadata: error.metadata,
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user