} else {
throw new OCPPError(
ErrorType.PROTOCOL_ERROR,
- `Cached request for message id ${messageId} response is not iterable`,
- requestCommandName
+ `Cached request for message id ${messageId} response is not iterable`
);
}
logger.debug(
throw new OCPPError(ErrorType.PROTOCOL_ERROR, errMsg);
}
} else {
- throw new OCPPError(
- ErrorType.PROTOCOL_ERROR,
- 'Incoming message is not iterable',
- Utils.isString(commandName) ? commandName : requestCommandName,
- { payload: request }
- );
+ throw new OCPPError(ErrorType.PROTOCOL_ERROR, 'Incoming message is not iterable', null, {
+ payload: request,
+ });
}
} catch (error) {
// Log
(await this.ocppRequestService.sendError(
messageId,
error as OCPPError,
- Utils.isString(commandName) ? commandName : requestCommandName
+ Utils.isString(commandName) ? commandName : requestCommandName ?? null
));
}
}