Add specific handling for DOMExceptions

This commit is contained in:
j433866 2019-05-08 16:42:06 +01:00
parent 65bb7f32e9
commit cbf1d2feb0

View File

@ -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;
}