-import { type IncomingMessage, Server, type ServerResponse } from 'http';
+import { type IncomingMessage, Server, type ServerResponse } from 'node:http';
import type { WebSocket } from 'ws';
import type { AbstractUIService } from './ui-services/AbstractUIService';
import { UIServiceFactory } from './ui-services/UIServiceFactory';
+import { BaseError } from '../../exception';
import {
AuthenticationType,
type ChargingStationData,
protected authenticate(req: IncomingMessage, next: (err?: Error) => void): void {
if (this.isBasicAuthEnabled() === true) {
if (this.isValidBasicAuth(req) === false) {
- next(new Error('Unauthorized'));
+ next(new BaseError('Unauthorized'));
}
next();
}