From 9c28f51817b60317f2c11a889e449a9801c5c072 Mon Sep 17 00:00:00 2001 From: Thomas Pronk Date: Thu, 29 Apr 2021 15:29:46 +0100 Subject: [PATCH] Write captured errors to body.data-report attribute --- src/core/PsychoJS.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/PsychoJS.js b/src/core/PsychoJS.js index cb72574..c3b26b2 100644 --- a/src/core/PsychoJS.js +++ b/src/core/PsychoJS.js @@ -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; };