From: Jérôme Benoit Date: Sun, 11 Sep 2022 21:48:11 +0000 (+0200) Subject: Improve error messages X-Git-Tag: v1.1.73~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9c5d9fa4cd1904b5e2d4c4a8277bed25865b61b6;p=e-mobility-charging-stations-simulator.git Improve error messages Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 17409e3a..767ea76d 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1547,9 +1547,11 @@ export default class ChargingStation { logger.error( `${this.logPrefix()} Incoming OCPP command '${ commandName ?? requestCommandName ?? null - }' message '${data.toString()}' matching cached request '${JSON.stringify( - this.requests.get(messageId) - )}' processing error:`, + }' message '${data.toString()}'${ + messageType !== MessageType.CALL_MESSAGE + ? ` matching cached request '${JSON.stringify(this.requests.get(messageId))}'` + : '' + } processing error:`, error ); if (error instanceof OCPPError === false) { diff --git a/src/charging-station/ui-server/UIServerFactory.ts b/src/charging-station/ui-server/UIServerFactory.ts index 2e524532..e7b341d1 100644 --- a/src/charging-station/ui-server/UIServerFactory.ts +++ b/src/charging-station/ui-server/UIServerFactory.ts @@ -18,7 +18,7 @@ export default class UIServerFactory { ): AbstractUIServer | null { if (UIServiceUtils.isLoopback(uiServerConfiguration.options?.host) === false) { console.warn( - chalk.magenta( + chalk.yellow( 'Loopback address not detected in UI server configuration. This is not recommended.' ) ); diff --git a/src/worker/WorkerUtils.ts b/src/worker/WorkerUtils.ts index 3b90b6fb..00feba44 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,7 @@ 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}`)); } }; }