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

Merge pull request #368 from tpronk/test_ready

Make PsychoJS test-ready again
This commit is contained in:
Sotiri Bakagiannis 2021-06-07 22:46:19 +01:00 committed by GitHub
commit 3b4dd80e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

8
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "psychojs", "name": "psychojs",
"version": "2021.x", "version": "2021.2.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "psychojs", "name": "psychojs",
"version": "2021.x", "version": "2021.2.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"howler": "^2.2.1", "howler": "^2.2.1",
@ -1708,7 +1708,7 @@
}, },
"node_modules/log4javascript": { "node_modules/log4javascript": {
"version": "1.4.16", "version": "1.4.16",
"resolved": "git+ssh://git@github.com/Ritzlgrmft/log4javascript.git#d27efb927c3c47ce9d747263427905d16ded2f2c" "resolved": "git+https://git@github.com/Ritzlgrmft/log4javascript.git#d27efb927c3c47ce9d747263427905d16ded2f2c"
}, },
"node_modules/lru-cache": { "node_modules/lru-cache": {
"version": "6.0.0", "version": "6.0.0",
@ -3815,7 +3815,7 @@
"dev": true "dev": true
}, },
"log4javascript": { "log4javascript": {
"version": "git+ssh://git@github.com/Ritzlgrmft/log4javascript.git#d27efb927c3c47ce9d747263427905d16ded2f2c", "version": "git+https://git@github.com/Ritzlgrmft/log4javascript.git#d27efb927c3c47ce9d747263427905d16ded2f2c",
"from": "log4javascript@github:Ritzlgrmft/log4javascript" "from": "log4javascript@github:Ritzlgrmft/log4javascript"
}, },
"lru-cache": { "lru-cache": {

View File

@ -1,6 +1,6 @@
{ {
"name": "psychojs", "name": "psychojs",
"version": "2021.x", "version": "2021.2.0",
"private": true, "private": true,
"description": "Helps run in-browser neuroscience, psychology, and psychophysics experiments", "description": "Helps run in-browser neuroscience, psychology, and psychophysics experiments",
"license": "MIT", "license": "MIT",

View File

@ -743,8 +743,15 @@ export class PsychoJS
}; };
window.onunhandledrejection = function (error) window.onunhandledrejection = function (error)
{ {
console.error(error.reason); console.error(error?.reason);
self._gui.dialog({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; return true;
}; };
} }