refactor: refine type casting in OCPP stack
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Nov 2023 20:51:45 +0000 (21:51 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Nov 2023 20:51:45 +0000 (21:51 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/OCPPRequestService.ts

index 849ecbd0382e461d1ab81e08e358e09824a1ed66..bb9a75feb4786fe033d02d2b16a1e0bf6afbc8fa 100644 (file)
@@ -12,7 +12,6 @@ import {
   type ErrorResponse,
   ErrorType,
   type IncomingRequestCommand,
-  type JsonObject,
   type JsonType,
   MessageType,
   type OCPPVersion,
@@ -462,7 +461,7 @@ export abstract class OCPPRequestService {
                 params?.skipBufferingOnError === false ? '' : 'non '
               }buffered message id '${messageId}' with content '${messageToSend}'`,
               commandName,
-              (messagePayload as JsonObject).details,
+              (messagePayload as OCPPError).details,
             ),
           );
         }