repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve OCPP stack error messages
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ocpp
/
OCPPIncomingRequestService.ts
diff --git
a/src/charging-station/ocpp/OCPPIncomingRequestService.ts
b/src/charging-station/ocpp/OCPPIncomingRequestService.ts
index 9980e5d89ec7a8406ec82aae4ddf261820be5bf5..dcef40287f014d9de35a04a95fa022a013a9ae37 100644
(file)
--- a/
src/charging-station/ocpp/OCPPIncomingRequestService.ts
+++ b/
src/charging-station/ocpp/OCPPIncomingRequestService.ts
@@
-9,8
+9,11
@@
export default abstract class OCPPIncomingRequestService {
this.chargingStation = chargingStation;
}
this.chargingStation = chargingStation;
}
- p
ublic handleIncomingRequestError(commandName: IncomingRequestCommand, error: Error): void
{
+ p
rotected handleIncomingRequestError<T>(commandName: IncomingRequestCommand, error: Error, errorOcppResponse?: T): T
{
logger.error(this.chargingStation.logPrefix() + ' Incoming request command ' + commandName + ' error: %j', error);
logger.error(this.chargingStation.logPrefix() + ' Incoming request command ' + commandName + ' error: %j', error);
+ if (errorOcppResponse) {
+ return errorOcppResponse;
+ }
throw error;
}
throw error;
}