The bug discovered in https://github.com/lorenzodonini/ocpp-go/issues/175 would cause responses not being sent out to the original endpoint, making debugging such cases difficult and potentially leading to starvation.
With the PR, the following behavior is introduced in v1.6 and v2.0.1:
if a response struct is invalid, an ocpp error is sent instead
if an error struct is invalid, a ocppj.GenericError is sent instead
if empty error and response struct are returned from a callback, a ocppj.GenericError is sent instead
These functionalities are covered by the HandleFailedResponseError method, added to both endpoints within the ocpp-j layer. The function is invoked by the actual ocpp16 and ocpp2 protocol packages.
Note: the introduced behavior will be run only once. If the HandleFailedResponseError method fails, no further retransmission attempts will be made.
The bug discovered in https://github.com/lorenzodonini/ocpp-go/issues/175 would cause responses not being sent out to the original endpoint, making debugging such cases difficult and potentially leading to starvation.
With the PR, the following behavior is introduced in v1.6 and v2.0.1:
ocppj.GenericError
is sent insteadocppj.GenericError
is sent insteadThese functionalities are covered by the
HandleFailedResponseError
method, added to both endpoints within the ocpp-j layer. The function is invoked by the actualocpp16
andocpp2
protocol packages.