From: Jérôme Benoit Date: Thu, 2 Sep 2021 20:07:40 +0000 (+0200) Subject: Fix OCPPError command attribute affectation X-Git-Tag: v1.0.54~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9292e32a92f3ef63ee5a3cf86dc497b8acae5d2d;p=e-mobility-charging-stations-simulator.git Fix OCPPError command attribute affectation Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/OCPPError.ts b/src/charging-station/ocpp/OCPPError.ts index ed77d54c..9c6f825a 100644 --- a/src/charging-station/ocpp/OCPPError.ts +++ b/src/charging-station/ocpp/OCPPError.ts @@ -13,7 +13,7 @@ export default class OCPPError extends Error { this.name = new.target.name; this.code = code ?? ErrorType.GENERIC_ERROR; this.message = message ?? ''; - this.message = command ?? ''; + this.command = command; this.details = details ?? {}; Object.setPrototypeOf(this, new.target.prototype); diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index a9f9b846..1e9df7ca 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -24,7 +24,7 @@ export default abstract class OCPPRequestService { } public async sendMessage(messageId: string, commandParams: any, messageType: MessageType, commandName: RequestCommand | IncomingRequestCommand, - skipBuffering = false): Promise { + skipBufferingOnError = false): Promise { // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; // Send a message through wsConnection @@ -58,7 +58,7 @@ export default abstract class OCPPRequestService { const beginId = PerformanceStatistics.beginMeasure(commandName); this.chargingStation.wsConnection.send(messageToSend); PerformanceStatistics.endMeasure(commandName, beginId); - } else if (!skipBuffering) { + } else if (!skipBufferingOnError) { // Buffer it this.chargingStation.addToMessageQueue(messageToSend); // Reject it