Enable custom promise error handling through overriding of global.onerror

This commit is contained in:
Gregory Huczynski
2020-11-13 12:06:10 +00:00
committed by Steve Gravrock
parent 88de272c89
commit 905e3fc3f9
2 changed files with 78 additions and 2 deletions

View File

@@ -67,9 +67,9 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
if (j$.isError_(event.reason)) {
event.reason.jasmineMessage =
'Unhandled promise rejection: ' + event.reason;
onerror(event.reason);
global.onerror(event.reason);
} else {
onerror('Unhandled promise rejection: ' + event.reason);
global.onerror('Unhandled promise rejection: ' + event.reason);
}
};