Send back HTTP error code from OCPP Command
MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
@@ -1358,7 +1358,7 @@ export default class ChargingStationService {
throw new AppError({
...LoggingHelper.getChargingStationProperties(chargingStation),
action: action,
- errorCode: HTTPError.GENERAL_ERROR,
+ errorCode: error instanceof AppError ? error.params.errorCode : HTTPError.GENERAL_ERROR,
message: `OCPP Command '${command}' has failed: ${error.message as string}`,
module: MODULE_NAME, method: 'handleAction',
user: req.user,

MODIFY
src/server/rest/v1/service/TransactionService.ts
src/server/rest/v1/service/TransactionService.ts
@@ -366,7 +366,7 @@ export default class TransactionService {
throw new AppError({
...LoggingHelper.getChargingStationProperties(chargingStation),
errorCode: HTTPError.GENERAL_ERROR,
- message: `${Utils.buildConnectorInfo(transaction.connectorId, transaction.id)} Cannot stop an ongoing Transaction`,
+ message: `${Utils.buildConnectorInfo(transaction.connectorId, transaction.id)} Cannot soft stop an ongoing Transaction`,
module: MODULE_NAME, method: 'handleTransactionSoftStop',
user: req.user, action: action
});

Send back HTTP error code from OCPP Command