Type OCPP requests
[e-mobility-charging-stations-simulator.git] / src / charging-station / OcppError.ts
index 1f384783a90e428c12bdb48ea7b05f8189ab4373..ae86c0a160138657b193aa413258349874570ca5 100644 (file)
@@ -1,13 +1,13 @@
-import Constants from '../utils/Constants';
+import { ErrorType } from '../types/ocpp/ErrorType';
 
 export default class OCPPError extends Error {
   code: string;
-  details;
+  details?: any;
 
-  constructor(code: string, message:string , details?) {
+  constructor(code: string, message: string, details?: any) {
     super(message);
 
-    this.code = code || Constants.OCPP_ERROR_GENERIC_ERROR;
+    this.code = code || ErrorType.GENERIC_ERROR;
     this.message = message || '';
     this.details = details || {};