diff --git a/src/core/ChefWorker.js b/src/core/ChefWorker.js index e1deaf0d..ee8b77ec 100644 --- a/src/core/ChefWorker.js +++ b/src/core/ChefWorker.js @@ -112,14 +112,25 @@ async function bake(data) { }) }); } catch (err) { - self.postMessage({ - action: "bakeError", - data: { - error: err, - id: data.id, - inputNum: data.inputNum - } - }); + if (err instanceof DOMException) { + self.postMessage({ + action: "bakeError", + data: { + error: err.message, + id: data.id, + inputNum: data.inputNum + } + }); + } else { + self.postMessage({ + action: "bakeError", + data: { + error: err, + id: data.id, + inputNum: data.inputNum + } + }); + } } self.inputNum = -1; }