Linter fixes
[e-mobility-charging-stations-simulator.git] / src / exception / OCPPError.ts
index cfcc4f40c8dacc0c6eefcd07e71706877cbb3c01..8e7dcc2f62b3b64d9812e3ccbb1941b634973187 100644 (file)
@@ -1,16 +1,21 @@
-// Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
-
-import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
+// Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
 import BaseError from './BaseError';
+import type { JsonType } from '../types/JsonType';
 import { ErrorType } from '../types/ocpp/ErrorType';
+import type { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
 
 export default class OCPPError extends BaseError {
-  code: ErrorType | IncomingRequestCommand;
+  code: ErrorType;
   command?: RequestCommand | IncomingRequestCommand;
-  details?: Record<string, unknown>;
+  details?: JsonType;
 
-  constructor(code: ErrorType | IncomingRequestCommand, message: string, command?: RequestCommand | IncomingRequestCommand, details?: Record<string, unknown>) {
+  constructor(
+    code: ErrorType,
+    message: string,
+    command?: RequestCommand | IncomingRequestCommand,
+    details?: JsonType
+  ) {
     super(message);
 
     this.code = code ?? ErrorType.GENERIC_ERROR;