Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Fixlets to OCPP error message format
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
  • Loading branch information
Jérôme Benoit committed Apr 17, 2022
1 parent b3ec7bc commit ac54a9b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/charging-station/ChargingStation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1517,8 +1517,7 @@ export default class ChargingStation {
} 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(
Expand Down Expand Up @@ -1573,12 +1572,9 @@ export default class ChargingStation {
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
Expand All @@ -1594,7 +1590,7 @@ export default class ChargingStation {
(await this.ocppRequestService.sendError(
messageId,
error as OCPPError,
Utils.isString(commandName) ? commandName : requestCommandName
Utils.isString(commandName) ? commandName : requestCommandName ?? null
));
}
}
Expand Down

0 comments on commit ac54a9b

Please sign in to comment.