Bug 1767042 - Improve the output of unexpected errors in `SimpleTest.js`. r=gbrown

Differential Revision: https://phabricator.services.mozilla.com/D145107
This commit is contained in:
William Durand 2022-04-29 21:02:33 +00:00
Родитель fa75862271
Коммит 31113891df
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -2100,9 +2100,16 @@ var add_task = (function() {
}
} catch (ex) {
try {
let serializedEx;
if (ex instanceof Error) {
serializedEx = `${ex}`;
} else {
serializedEx = JSON.stringify(ex);
}
SimpleTest.record(
false,
"" + ex,
serializedEx,
"Should not throw any errors",
ex.stack
);