}
logger.debug(
`${this.logPrefix()} << Command '${
- requestCommandName ?? 'unknown'
+ requestCommandName ?? Constants.UNKNOWN_COMMAND
}' received response payload: ${JSON.stringify(request)}`
);
responseCallback(commandPayload, requestPayload);
}
logger.debug(
`${this.logPrefix()} << Command '${
- requestCommandName ?? 'unknown'
+ requestCommandName ?? Constants.UNKNOWN_COMMAND
}' received error payload: ${JSON.stringify(request)}`
);
errorCallback(new OCPPError(errorType, errorMessage, requestCommandName, errorDetails));
// Log
logger.error(
`${this.logPrefix()} Incoming OCPP command '${
- commandName ?? requestCommandName ?? null
+ commandName ?? requestCommandName ?? Constants.UNKNOWN_COMMAND
}' message '${data.toString()}'${
messageType !== MessageType.CALL_MESSAGE
? ` matching cached request '${JSON.stringify(this.requests.get(messageId))}'`
if (error instanceof OCPPError === false) {
logger.warn(
`${this.logPrefix()} Error thrown at incoming OCPP command '${
- commandName ?? requestCommandName ?? null
+ commandName ?? requestCommandName ?? Constants.UNKNOWN_COMMAND
}' message '${data.toString()}' handling is not an OCPPError:`,
error
);