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
Convert types to native type
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ocpp
/
OCPPRequestService.ts
diff --git
a/src/charging-station/ocpp/OCPPRequestService.ts
b/src/charging-station/ocpp/OCPPRequestService.ts
index 653679e9b9e5b3452bcf508dc8a2be886022ff51..68338670aa1c4dd710ec1310568328e7d13dd198 100644
(file)
--- a/
src/charging-station/ocpp/OCPPRequestService.ts
+++ b/
src/charging-station/ocpp/OCPPRequestService.ts
@@
-37,6
+37,7
@@
export default abstract class OCPPRequestService {
this.ajv = new Ajv();
ajvFormats(this.ajv);
this.requestHandler.bind(this);
this.ajv = new Ajv();
ajvFormats(this.ajv);
this.requestHandler.bind(this);
+ this.sendMessage.bind(this);
this.sendResponse.bind(this);
this.sendError.bind(this);
this.internalSendMessage.bind(this);
this.sendResponse.bind(this);
this.sendError.bind(this);
this.internalSendMessage.bind(this);
@@
-71,7
+72,7
@@
export default abstract class OCPPRequestService {
);
} catch (error) {
this.handleSendMessageError(chargingStation, commandName, error as Error, {
);
} catch (error) {
this.handleSendMessageError(chargingStation, commandName, error as Error, {
- throwError:
fals
e,
+ throwError:
tru
e,
});
}
}
});
}
}
@@
-116,9
+117,7
@@
export default abstract class OCPPRequestService {
params
);
} catch (error) {
params
);
} catch (error) {
- this.handleSendMessageError(chargingStation, commandName, error as Error, {
- throwError: false,
- });
+ this.handleSendMessageError(chargingStation, commandName, error as Error);
}
}
}
}
@@
-364,10
+363,10
@@
export default abstract class OCPPRequestService {
chargingStation: ChargingStation,
commandName: RequestCommand | IncomingRequestCommand,
error: Error,
chargingStation: ChargingStation,
commandName: RequestCommand | IncomingRequestCommand,
error: Error,
- params: HandleErrorParams<EmptyObject> = { throwError:
tru
e }
+ params: HandleErrorParams<EmptyObject> = { throwError:
fals
e }
): void {
logger.error(`${chargingStation.logPrefix()} Request command '${commandName}' error:`, error);
): void {
logger.error(`${chargingStation.logPrefix()} Request command '${commandName}' error:`, error);
- if (params?.throwError) {
+ if (params?.throwError
=== true
) {
throw error;
}
}
throw error;
}
}