Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_NOT_IMPLEMENTED;
}
} catch (error) {
- return this.handleIncomingRequestError(IncomingRequestCommand.TRIGGER_MESSAGE, error, Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED) as OCPP16TriggerMessageResponse;
+ return this.handleIncomingRequestError(IncomingRequestCommand.TRIGGER_MESSAGE, error, Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_REJECTED);
}
}
}
this.chargingStation = chargingStation;
}
- protected handleIncomingRequestError(commandName: IncomingRequestCommand, error: Error, errorOcppResponse?: Record<string, unknown>): unknown {
+ protected handleIncomingRequestError<T>(commandName: IncomingRequestCommand, error: Error, errorOcppResponse?: T): T {
logger.error(this.chargingStation.logPrefix() + ' Incoming request command ' + commandName + ' error: %j', error);
if (errorOcppResponse) {
return errorOcppResponse;