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
|
// create the slicer worker
|
||||||
const slicerWorker = new SlicerWorker();
|
const slicerWorker = new SlicerWorker();
|
||||||
|
|
||||||
slicerWorker.onerror = error => {
|
slicerWorker.addEventListener('error', event => {
|
||||||
slicerWorker.terminate();
|
slicerWorker.terminate();
|
||||||
reject(error);
|
reject(event);
|
||||||
};
|
});
|
||||||
|
|
||||||
// listen to messages send from worker
|
// listen to messages send from worker
|
||||||
slicerWorker.addEventListener('message', (event) => {
|
slicerWorker.addEventListener('message', (event) => {
|
||||||
|
@ -12,7 +12,7 @@ const onProgress = progress => {
|
|||||||
|
|
||||||
const loader = new JSONLoader();
|
const loader = new JSONLoader();
|
||||||
|
|
||||||
self.addEventListener('message', async (event) => {
|
self.addEventListener('message', (event) => {
|
||||||
const { message, data } = event.data;
|
const { message, data } = event.data;
|
||||||
switch (message) {
|
switch (message) {
|
||||||
case 'SLICE': {
|
case 'SLICE': {
|
||||||
|
Loading…
Reference in New Issue
Block a user