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) { } catch (err) {
self.postMessage({ if (err instanceof DOMException) {
action: "bakeError", self.postMessage({
data: { action: "bakeError",
error: err, data: {
id: data.id, error: err.message,
inputNum: data.inputNum id: data.id,
} inputNum: data.inputNum
}); }
});
} else {
self.postMessage({
action: "bakeError",
data: {
error: err,
id: data.id,
inputNum: data.inputNum
}
});
}
} }
self.inputNum = -1; self.inputNum = -1;
} }