Skip to content

Commit 946e514

Browse files
Merge pull request #13 from exelearning/6-improve-error-handling
Make Web Worker handling more robust
2 parents b0cf1b8 + 4c6c06f commit 946e514

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

js/app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,10 @@
514514
};
515515

516516
worker.onerror = (error) => {
517-
console.error('[App] Worker error:', error);
518-
reject(new Error(error.message || i18n.t('errors.processingFailed')));
517+
console.error('[App] Worker crashed:', error);
518+
state.zipWorker.terminate();
519+
state.zipWorker = null;
520+
reject(new Error(i18n.t('errors.processingFailed')));
519521
};
520522

521523
// Send file to worker for processing

0 commit comments

Comments
 (0)