X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Focpp%2FOCPPRequestService.ts;h=4115eff1144f1c50a91e79f7197632f47fd6e553;hb=617cad0c86c3fea53b56a738bb0d6ddc3da05237;hp=f4299226115029a41a7271c063e14ae44209f2ac;hpb=60a743910478b70e39dcefa5e1b752ec8a93880e;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index f4299226..4115eff1 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -4,8 +4,7 @@ import ajvFormats from 'ajv-formats'; import { type OCPPResponseService, OCPPServiceUtils } from './internal'; import type { ChargingStation } from '../../charging-station'; import { OCPPError } from '../../exception'; -// import { PerformanceStatistics } from '../../performance'; -import { PerformanceStatistics } from '../../performance/PerformanceStatistics'; +import { PerformanceStatistics } from '../../performance'; import { type EmptyObject, type ErrorCallback, @@ -276,7 +275,7 @@ export abstract class OCPPRequestService { ErrorType.GENERIC_ERROR, `WebSocket closed or errored for buffered message id '${messageId}' with content '${messageToSend}'`, commandName, - (messagePayload as JsonObject)?.details ?? {} + (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT ) ); } else if (wsClosedOrErrored) { @@ -284,7 +283,7 @@ export abstract class OCPPRequestService { ErrorType.GENERIC_ERROR, `WebSocket closed or errored for non buffered message id '${messageId}' with content '${messageToSend}'`, commandName, - (messagePayload as JsonObject)?.details ?? {} + (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT ); // Reject response if (messageType !== MessageType.CALL_MESSAGE) { @@ -359,7 +358,7 @@ export abstract class OCPPRequestService { ErrorType.GENERIC_ERROR, `Timeout for message id '${messageId}'`, commandName, - (messagePayload as JsonObject)?.details ?? {} + (messagePayload as JsonObject)?.details ?? Constants.EMPTY_FREEZED_OBJECT ), () => { messageType === MessageType.CALL_MESSAGE && chargingStation.requests.delete(messageId);