mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 03:23:48 +01:00
fix catching errors in the worker
This commit is contained in:
parent
9f1958563d
commit
222a27d5b5
@ -63,10 +63,10 @@ function sliceAsync(settings, geometry, openObjectIndexes, constructLinePreview,
|
||||
// create the slicer worker
|
||||
const slicerWorker = new SlicerWorker();
|
||||
|
||||
slicerWorker.onerror = error => {
|
||||
slicerWorker.addEventListener('error', event => {
|
||||
slicerWorker.terminate();
|
||||
reject(error);
|
||||
};
|
||||
reject(event);
|
||||
});
|
||||
|
||||
// listen to messages send from worker
|
||||
slicerWorker.addEventListener('message', (event) => {
|
||||
|
@ -12,7 +12,7 @@ const onProgress = progress => {
|
||||
|
||||
const loader = new JSONLoader();
|
||||
|
||||
self.addEventListener('message', async (event) => {
|
||||
self.addEventListener('message', (event) => {
|
||||
const { message, data } = event.data;
|
||||
switch (message) {
|
||||
case 'SLICE': {
|
||||
|
Loading…
Reference in New Issue
Block a user