better error handling in case of loader error in tests

This commit is contained in:
Joao Moreno
2019-06-24 07:47:26 -07:00
parent 59e50ff799
commit 18dfdcbf52
2 changed files with 15 additions and 1 deletions

View File

@@ -273,5 +273,12 @@ function runTests(opts) {
ipcRenderer.on('run', (e, opts) => {
initLoader(opts);
runTests(opts).catch(err => console.error(typeof err === 'string' ? err : JSON.stringify(err)));
runTests(opts).catch(err => {
if (!(typeof err !== 'string')) {
err = JSON.stringify(err);
}
console.error(err);
ipcRenderer.send('error', err);
});
});