Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions src/core/PsychoJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,30 +728,15 @@ export class PsychoJS
window.onerror = function (message, source, lineno, colno, error)
{
console.error(error);

// Log errors in data-error, for processing by WebDriverIO tests
document.body.setAttribute('data-error', JSON.stringify({
message: message,
source: source,
lineno: lineno,
colno: colno,
error: error
}));

self._gui.dialog({"error": error});

return true;
};
window.onunhandledrejection = function (error)
{
console.error(error?.reason);
if (error?.reason?.stack === undefined) {
// No stack? Error thrown by PsychoJS; stringify whole error
document.body.setAttribute('data-error', JSON.stringify(error?.reason));
} else {
// Yes stack? Error thrown by JS; stringify stack
document.body.setAttribute('data-error', JSON.stringify(error?.reason?.stack));
}
self._gui.dialog({error: error?.reason});
return true;
};
}
Expand Down