@@ -771,22 +771,37 @@ void ChargePoint::message_callback(const std::string& message) {
771
771
}
772
772
} catch (const EvseOutOfRangeException& e) {
773
773
EVLOG_error << " Exception during handling of message: " << e.what ();
774
+ if (enhanced_message.messageTypeId != MessageTypeId::CALL) {
775
+ return ; // CALLERROR shall only follow on a CALL message
776
+ }
774
777
auto call_error = CallError (enhanced_message.uniqueId , " OccurrenceConstraintViolation" , e.what (), json ({}));
775
778
this ->message_dispatcher ->dispatch_call_error (call_error);
776
779
} catch (const ConnectorOutOfRangeException& e) {
777
780
EVLOG_error << " Exception during handling of message: " << e.what ();
781
+ if (enhanced_message.messageTypeId != MessageTypeId::CALL) {
782
+ return ; // CALLERROR shall only follow on a CALL message
783
+ }
778
784
auto call_error = CallError (enhanced_message.uniqueId , " OccurrenceConstraintViolation" , e.what (), json ({}));
779
785
this ->message_dispatcher ->dispatch_call_error (call_error);
780
786
} catch (const EnumConversionException& e) {
781
787
EVLOG_error << " EnumConversionException during handling of message: " << e.what ();
788
+ if (enhanced_message.messageTypeId != MessageTypeId::CALL) {
789
+ return ; // CALLERROR shall only follow on a CALL message
790
+ }
782
791
auto call_error = CallError (enhanced_message.uniqueId , " FormationViolation" , e.what (), json ({}));
783
792
this ->message_dispatcher ->dispatch_call_error (call_error);
784
793
} catch (const TimePointParseException& e) {
785
794
EVLOG_error << " Exception during handling of message: " << e.what ();
795
+ if (enhanced_message.messageTypeId != MessageTypeId::CALL) {
796
+ return ; // CALLERROR shall only follow on a CALL message
797
+ }
786
798
auto call_error = CallError (enhanced_message.uniqueId , " FormationViolation" , e.what (), json ({}));
787
799
this ->message_dispatcher ->dispatch_call_error (call_error);
788
800
} catch (json::exception & e) {
789
801
EVLOG_error << " JSON exception during handling of message: " << e.what ();
802
+ if (enhanced_message.messageTypeId != MessageTypeId::CALL) {
803
+ return ; // CALLERROR shall only follow on a CALL message
804
+ }
790
805
if (json_message.is_array () and json_message.size () > MESSAGE_ID) {
791
806
auto call_error = CallError (enhanced_message.uniqueId , " FormationViolation" , e.what (), json ({}));
792
807
this ->message_dispatcher ->dispatch_call_error (call_error);
0 commit comments