Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling in ocpp/charge_point.py #493

Closed
Jared-Newell-Mobility opened this issue Oct 19, 2023 · 0 comments
Closed

Improve error handling in ocpp/charge_point.py #493

Jared-Newell-Mobility opened this issue Oct 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Jared-Newell-Mobility
Copy link
Contributor

see #426

Table 7 of the Open Charge Point Protocol JSON 1.6, OCPP-J 1.6 Specification lists all error codes with a short description.

NotSupported - Requested Action is not known by receiver
NotImplemented - Requested Action is recognized but not supported by the receiver charge_point.py:175 can indicate both problems.
Trying to send a request with action "InvalidAction" triggers this code path. In this case, a NotSupportedError would be fitting.

However, the code path is also executed when the receiver receives a request for an action the receiver doesn't implement. For example, if a charger receives a "GetDiagnostics" request without supporting this feature. Now NotImplementedError would be suitable.

A while ago, we changed the error type from "NotImplementedErrortoNotSupportedError`. See c6e7e48

I'm hesitant to revert that change by approving this PR. Instead, some code should be include to distinguish between 2 scenarios I described and raise the appropriate error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant