X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerUtils.ts;h=4d6868f76f35cf77166cfcff54c7e23ccae0036d;hb=8bd02502e5cb44f91964241a5bc93b762ca7557e;hp=3b90b6fb78cf301017ea746aa2fb47b7298b68e9;hpb=51c83d6f833f27f9990c17fc380ab5ee618894b1;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerUtils.ts b/src/worker/WorkerUtils.ts index 3b90b6fb..4d6868f7 100644 --- a/src/worker/WorkerUtils.ts +++ b/src/worker/WorkerUtils.ts @@ -1,5 +1,3 @@ -import { threadId } from 'worker_threads'; - import chalk from 'chalk'; export class WorkerUtils { @@ -9,7 +7,11 @@ export class WorkerUtils { public static defaultExitHandler = (code: number): void => { if (code !== 0) { - console.error(chalk.red(`Worker ${threadId} stopped with exit code ${code}`)); + console.error(chalk.red(`Worker stopped with exit code ${code}`)); } }; + + public static defaultErrorHandler = (error: Error): void => { + console.error(chalk.red('Worker errored: ', error)); + }; }