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 Exception handling and CallError responses #335

Merged
merged 3 commits into from
May 11, 2022

Conversation

proelke
Copy link
Collaborator

@proelke proelke commented May 10, 2022

This PR is to improve the exception handling in validating messages and to make the CallError messages closer to the OCPP spec. Quick overview:

  • Added missing NotSupported to the exception list.
  • Changed usage of NotImplemented to NotSupported when a handler doesn't exist.
  • Use the default description and moved additional information to details
  • Reduce the usage of ValidationError as it is not a valid OCPP error type, doesn't generate a CallError, and crashes the code when handling messages. I've tried to replace them with relevant OCPP error types.

@proelke proelke requested review from OrangeTux and tropxy as code owners May 10, 2022 16:49
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
8.1% 8.1% Duplication

Copy link
Contributor

@OrangeTux OrangeTux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Adding details to the CallError is pretty useful for debugging.

@OrangeTux OrangeTux merged commit c6e7e48 into mobilityhouse:master May 11, 2022
@proelke
Copy link
Collaborator Author

proelke commented May 11, 2022

❤️

ajmirsky pushed a commit to ajmirsky/ocpp that referenced this pull request Nov 26, 2024
* Added missing NotSupported to the exception list.
* Changed usage of NotImplemented to NotSupported when a handler doesn't exist.
*Use the default description and moved additional information to details
* Reduce the usage of ValidationError as it is not a valid OCPP error type, doesn't generate a CallError, and crashes the code when handling messages. I've tried to replace them with relevant OCPP error types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants