fix: start web socket ping interval at successful connection
[e-mobility-charging-stations-simulator.git] / src / utils / ErrorUtils.ts
index bd4fcf375ca334e96c62afa5d09b88cc8fa7a21b..36a5f04ca944df16e9b37bb186e1deb54dd01c12 100644 (file)
@@ -2,8 +2,6 @@ import process from 'node:process'
 
 import chalk from 'chalk'
 
-import { logger } from './Logger.js'
-import { isNotEmptyString } from './Utils.js'
 import type { ChargingStation } from '../charging-station/index.js'
 import type {
   EmptyObject,
@@ -13,6 +11,8 @@ import type {
   JsonType,
   RequestCommand
 } from '../types/index.js'
+import { logger } from './Logger.js'
+import { isNotEmptyString } from './Utils.js'
 
 const defaultErrorParams = {
   throwError: true,
@@ -80,7 +80,10 @@ export const handleSendMessageError = (
   chargingStation: ChargingStation,
   commandName: RequestCommand | IncomingRequestCommand,
   error: Error,
-  params: HandleErrorParams<EmptyObject> = { throwError: false, consoleOut: false }
+  params: HandleErrorParams<EmptyObject> = {
+    throwError: false,
+    consoleOut: false
+  }
 ): void => {
   setDefaultErrorParams(params, { throwError: false, consoleOut: false })
   logger.error(`${chargingStation.logPrefix()} Request command '${commandName}' error:`, error)