Use the fixed JsonType definition where appropriate
[e-mobility-charging-stations-simulator.git] / src / exception / OCPPError.ts
index 8b108aec535255e746ee6d2c7e630ff49581b43d..e67f3c95f56c38b81a22e1c70a1be191199e610c 100644 (file)
@@ -7,11 +7,16 @@ import { ErrorType } from '../types/ocpp/ErrorType';
 import { JsonType } from '../types/JsonType';
 
 export default class OCPPError extends BaseError {
-  code: ErrorType | IncomingRequestCommand;
+  code: ErrorType;
   command?: RequestCommand | IncomingRequestCommand;
   details?: JsonType;
 
-  constructor(code: ErrorType | IncomingRequestCommand, message: string, command?: RequestCommand | IncomingRequestCommand, details?: JsonType) {
+  constructor(
+    code: ErrorType,
+    message: string,
+    command?: RequestCommand | IncomingRequestCommand,
+    details?: JsonType
+  ) {
     super(message);
 
     this.code = code ?? ErrorType.GENERIC_ERROR;