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
Log also ws closing reason
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ChargingStation.ts
diff --git
a/src/charging-station/ChargingStation.ts
b/src/charging-station/ChargingStation.ts
index 72c781fc4ddf2b1a8b10b68f21c067ccb8ab938f..103a96f0bdc970b003169adccb801009a4d1c57b 100644
(file)
--- a/
src/charging-station/ChargingStation.ts
+++ b/
src/charging-station/ChargingStation.ts
@@
-631,15
+631,17
@@
export default class ChargingStation {
this.hasSocketRestarted = false;
}
this.hasSocketRestarted = false;
}
- private async onClose(code: number): Promise<void> {
+ private async onClose(code: number
, reason: string
): Promise<void> {
switch (code) {
switch (code) {
- case WebSocketCloseEventStatusCode.CLOSE_NORMAL: // Normal close
+ // Normal close
+ case WebSocketCloseEventStatusCode.CLOSE_NORMAL:
case WebSocketCloseEventStatusCode.CLOSE_NO_STATUS:
case WebSocketCloseEventStatusCode.CLOSE_NO_STATUS:
- logger.info(`${this.logPrefix()} Socket normally closed with status '${Utils.getWebSocketCloseEventStatusString(code)}'`);
+ logger.info(`${this.logPrefix()} Socket normally closed with status '${Utils.getWebSocketCloseEventStatusString(code)}'
and reason '${reason}'
`);
this.autoReconnectRetryCount = 0;
break;
this.autoReconnectRetryCount = 0;
break;
- default: // Abnormal close
- logger.error(`${this.logPrefix()} Socket abnormally closed with status '${Utils.getWebSocketCloseEventStatusString(code)}'`);
+ // Abnormal close
+ default:
+ logger.error(`${this.logPrefix()} Socket abnormally closed with status '${Utils.getWebSocketCloseEventStatusString(code)} and reason '${reason}'`);
await this.reconnect(code);
break;
}
await this.reconnect(code);
break;
}