mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-24 09:21:45 +00:00
Fix thrown errors not appearing in console
This commit is contained in:
parent
5dc4b4eaae
commit
3657cfb810
1 changed files with 4 additions and 2 deletions
|
@ -32,14 +32,16 @@ console.error = function (...args) {
|
||||||
error(...args);
|
error(...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.onerror = function (event, source, lineno, colno, error) {
|
window.onerror = function (event, source, lineno, colno, err) {
|
||||||
state.errors.push(error instanceof Error ? error : new Error(JSON.stringify(error)));
|
state.errors.push(err instanceof Error ? err : new Error(JSON.stringify(err)));
|
||||||
|
error(err);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
window.onunhandledrejection = function (event) {
|
window.onunhandledrejection = function (event) {
|
||||||
state.errors.push(
|
state.errors.push(
|
||||||
event.reason instanceof Error ? event.reason : new Error(JSON.stringify(event.reason))
|
event.reason instanceof Error ? event.reason : new Error(JSON.stringify(event.reason))
|
||||||
);
|
);
|
||||||
|
error(event.reason);
|
||||||
};
|
};
|
||||||
|
|
||||||
document.title = projInfo.title;
|
document.title = projInfo.title;
|
||||||
|
|
Loading…
Reference in a new issue