Remove uneeded condition on transaction status in ATG
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPIncomingRequestService.ts
index 6f91ead088003a09baf2f5b3c419da349fe0c35a..dcef40287f014d9de35a04a95fa022a013a9ae37 100644 (file)
@@ -9,10 +9,10 @@ export default abstract class OCPPIncomingRequestService {
     this.chargingStation = chargingStation;
   }
 
-  protected handleIncomingRequestError(commandName: IncomingRequestCommand, error: Error, ocppResponse?): unknown {
+  protected handleIncomingRequestError<T>(commandName: IncomingRequestCommand, error: Error, errorOcppResponse?: T): T {
     logger.error(this.chargingStation.logPrefix() + ' Incoming request command ' + commandName + ' error: %j', error);
-    if (ocppResponse) {
-      return ocppResponse;
+    if (errorOcppResponse) {
+      return errorOcppResponse;
     }
     throw error;
   }