cdb75027986bf1413b0571bc5d908f4bed0217b5
1 // Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
3 import { IncomingRequestCommand
, RequestCommand
} from
'../../types/ocpp/Requests';
5 import BaseError from
'../../exception/BaseError';
6 import { ErrorType
} from
'../../types/ocpp/ErrorType';
8 export default class OCPPError
extends BaseError
{
9 code
: ErrorType
| IncomingRequestCommand
;
10 command
?: RequestCommand
| IncomingRequestCommand
;
11 details
?: Record
<string, unknown
>;
13 constructor(code
: ErrorType
| IncomingRequestCommand
, message
: string, command
?: RequestCommand
| IncomingRequestCommand
, details
?: Record
<string, unknown
>) {
16 this.code
= code
?? ErrorType
.GENERIC_ERROR
;
17 this.command
= command
;
18 this.details
= details
?? {};