@matterbridge/thread 3.7.6-dev-20260428-956dcc7 → 3.7.6-dev-20260430-44fc966

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  if (process.argv.includes('--loader') || process.argv.includes('-loader'))
2
2
  console.log('\u001B[32mWorkerWrapper loaded.\u001B[40;0m');
3
3
  import { isMainThread, parentPort, threadId, workerData } from 'node:worker_threads';
4
+ import { inspectError } from '@matterbridge/utils';
4
5
  import { hasParameter } from '@matterbridge/utils/cli';
5
6
  import { formatBytes } from '@matterbridge/utils/format';
6
7
  import { AnsiLogger, debugStringify, MAGENTA } from 'node-ansi-logger';
@@ -75,8 +76,16 @@ export class WorkerWrapper {
75
76
  this.logWorkerInfo(this.log, false);
76
77
  if (!isMainThread) {
77
78
  setImmediate(async () => {
78
- const success = await callback(this);
79
- this.destroy(success);
79
+ let success = false;
80
+ try {
81
+ success = await callback(this);
82
+ }
83
+ catch (err) {
84
+ inspectError(this.log, `Worker ${this.name} callback failed`, err);
85
+ }
86
+ finally {
87
+ this.destroy(success);
88
+ }
80
89
  });
81
90
  }
82
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matterbridge/thread",
3
- "version": "3.7.6-dev-20260428-956dcc7",
3
+ "version": "3.7.6-dev-20260430-44fc966",
4
4
  "description": "Matterbridge thread library",
5
5
  "author": "https://github.com/Luligu",
6
6
  "homepage": "https://matterbridge.io/",
@@ -69,8 +69,8 @@
69
69
  "CHANGELOG.md"
70
70
  ],
71
71
  "dependencies": {
72
- "@matterbridge/types": "3.7.6-dev-20260428-956dcc7",
73
- "@matterbridge/utils": "3.7.6-dev-20260428-956dcc7",
72
+ "@matterbridge/types": "3.7.6-dev-20260430-44fc966",
73
+ "@matterbridge/utils": "3.7.6-dev-20260430-44fc966",
74
74
  "@zip.js/zip.js": "2.8.26",
75
75
  "node-ansi-logger": "3.2.1"
76
76
  }