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;
}