1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-11 16:18:10 +00:00

Write captured errors to body.data-report attribute

This commit is contained in:
Thomas Pronk 2021-04-29 15:29:46 +01:00
parent 5a12d3210c
commit 9c28f51817

View File

@ -691,6 +691,13 @@ export class PsychoJS
window.onerror = function (message, source, lineno, colno, error)
{
console.error(error);
document.body.setAttribute('data-error', JSON.stringify({
message: message,
source: source,
lineno: lineno,
colno: colno,
error: error.stack
}));
self._gui.dialog({"error": error});
return true;
};