repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 1.1.24
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ocpp
/
OCPPError.ts
diff --git
a/src/charging-station/ocpp/OCPPError.ts
b/src/charging-station/ocpp/OCPPError.ts
index 9c6f825a6526a3f903c4b2a70e230b6fb2de3103..cdb75027986bf1413b0571bc5d908f4bed0217b5 100644
(file)
--- a/
src/charging-station/ocpp/OCPPError.ts
+++ b/
src/charging-station/ocpp/OCPPError.ts
@@
-1,23
+1,20
@@
+// Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
+
import { IncomingRequestCommand, RequestCommand } from '../../types/ocpp/Requests';
import { IncomingRequestCommand, RequestCommand } from '../../types/ocpp/Requests';
+import BaseError from '../../exception/BaseError';
import { ErrorType } from '../../types/ocpp/ErrorType';
import { ErrorType } from '../../types/ocpp/ErrorType';
-export default class OCPPError extends Error {
+export default class OCPPError extends
Base
Error {
code: ErrorType | IncomingRequestCommand;
command?: RequestCommand | IncomingRequestCommand;
code: ErrorType | IncomingRequestCommand;
command?: RequestCommand | IncomingRequestCommand;
- details?:
unknown
;
+ details?:
Record<string, unknown>
;
- constructor(code: ErrorType | IncomingRequestCommand, message: string, command?: RequestCommand | IncomingRequestCommand, details?:
unknown
) {
+ constructor(code: ErrorType | IncomingRequestCommand, message: string, command?: RequestCommand | IncomingRequestCommand, details?:
Record<string, unknown>
) {
super(message);
super(message);
- this.name = new.target.name;
this.code = code ?? ErrorType.GENERIC_ERROR;
this.code = code ?? ErrorType.GENERIC_ERROR;
- this.message = message ?? '';
this.command = command;
this.details = details ?? {};
this.command = command;
this.details = details ?? {};
-
- Object.setPrototypeOf(this, new.target.prototype);
-
- Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : (this.stack = (new Error()).stack);
}
}
}
}