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
refactor: factor out default OCPP request params value
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ui-server
/
UIWebSocketServer.ts
diff --git
a/src/charging-station/ui-server/UIWebSocketServer.ts
b/src/charging-station/ui-server/UIWebSocketServer.ts
index cc00db13f233af42975062331f054992135ce510..5ddf0e5901109321606ac5607b6aa821a7956648 100644
(file)
--- a/
src/charging-station/ui-server/UIWebSocketServer.ts
+++ b/
src/charging-station/ui-server/UIWebSocketServer.ts
@@
-49,7
+49,15
@@
export class UIWebSocketServer extends AbstractUIServer {
}
const [requestId] = request as ProtocolRequest;
this.responseHandlers.set(requestId, ws);
}
const [requestId] = request as ProtocolRequest;
this.responseHandlers.set(requestId, ws);
- this.uiServices.get(version)?.requestHandler(request).catch(Constants.EMPTY_FUNCTION);
+ this.uiServices
+ .get(version)
+ ?.requestHandler(request)
+ .then((protocolResponse: ProtocolResponse) => {
+ if (!Utils.isNullOrUndefined(protocolResponse)) {
+ this.sendResponse(protocolResponse);
+ }
+ })
+ .catch(Constants.EMPTY_FUNCTION);
});
ws.on('error', (error) => {
logger.error(`${this.logPrefix(moduleName, 'start.ws.onerror')} WebSocket error:`, error);
});
ws.on('error', (error) => {
logger.error(`${this.logPrefix(moduleName, 'start.ws.onerror')} WebSocket error:`, error);