Skip to content
New issue

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

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

Already on GitHub? # to your account

Deduplicate NotFound error in client #48

Open
pohlm01 opened this issue Oct 28, 2024 · 0 comments
Open

Deduplicate NotFound error in client #48

pohlm01 opened this issue Oct 28, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@pohlm01
Copy link
Member

pohlm01 commented Oct 28, 2024

Currently, there are two error types in the Client implementation that essentially have the same meaning: Error::ObjectNotFound and Error::Problem(openadr_wire::problem::Problem) with a 404 error code.

The first is created in the get_*_by_name() methods, if the returned list is empty, while the second gets sent by the VTN, e.g., server.

It would be nice to streamline them somehow, such that a user of the library does not get surprised by at 'NotFound' error, although it properly handled one of the two error types.
I don't have a perfect proposal on how to deal with that ready yet. I could imagine integrating a special handling for a 404 status in the ClientRef::request() method, but there might be better alternatives.

The Error::is_not_found() method should be adopted accordingly.

@pohlm01 pohlm01 converted this from a draft issue Oct 28, 2024
@pohlm01 pohlm01 added the good first issue Good for newcomers label Oct 28, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

1 participant