- await this.chargingStation.ocppRequestService.sendError(messageId, new OCPPError(ErrorType.NOT_IMPLEMENTED, `${commandName} is not implemented`, {}), commandName);
- throw new Error(`${commandName} is not implemented to handle payload ${JSON.stringify(commandPayload)}`);
+ const error = new OCPPError(ErrorType.NOT_IMPLEMENTED, `${commandName} is not implemented to handle payload ${JSON.stringify(commandPayload, null, 2)}`);
+ await this.chargingStation.ocppRequestService.sendError(messageId, error, commandName);
+ throw error;