Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
public constructor(chargingStation: ChargingStation) {
if (new.target?.name === 'OCPP16IncomingRequestService') {
- throw new TypeError('Cannot construct OCPP16IncomingRequestService instances directly');
+ throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
}
super(chargingStation);
this.incomingRequestHandlers = new Map<OCPP16IncomingRequestCommand, IncomingRequestHandler>([
export default class OCPP16RequestService extends OCPPRequestService {
public constructor(chargingStation: ChargingStation, ocppResponseService: OCPPResponseService) {
if (new.target?.name === 'OCPP16RequestService') {
- throw new TypeError('Cannot construct OCPP16RequestService instances directly');
+ throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
}
super(chargingStation, ocppResponseService);
}
public constructor(chargingStation: ChargingStation) {
if (new.target?.name === 'OCPP16ResponseService') {
- throw new TypeError('Cannot construct OCPP16ResponseService instances directly');
+ throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
}
super(chargingStation);
this.responseHandlers = new Map<OCPP16RequestCommand, ResponseHandler>([