Skip to content

Ensure inputs to BaseBackendError are available when thrown #6056

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

Closed
bisgaard-itis opened this issue Jul 11, 2024 · 0 comments · Fixed by #6064
Closed

Ensure inputs to BaseBackendError are available when thrown #6056

bisgaard-itis opened this issue Jul 11, 2024 · 0 comments · Fixed by #6064
Assignees
Labels
a:apiserver api-server service t:enhancement Improvement or request on an existing feature

Comments

@bisgaard-itis
Copy link
Contributor

bisgaard-itis commented Jul 11, 2024

When the api-server sends a request to a backend service an httpx.HTTPStatusError may be thrown. In the api-server we have an exception handling system which converts this into a BaseBackendError which will then either be caught in the api-server and handled or go all the way out to an exception handler which will convert it to an http reponse and send it back to the user. The challenge is that these BaseBackendErrors require input arguments upon creation and those are taken automatically from the backend client methods. Currently there is no mechanism in place to "statically", or "at import time", check that those keyword arguments will actually be available. We should add a mechanism to do this as it can lead to some quite embarrassing errors otherwise.

Here is where this check will have to be added:

def service_exception_mapper(
service_name: str,

@bisgaard-itis bisgaard-itis added the t:enhancement Improvement or request on an existing feature label Jul 11, 2024
@bisgaard-itis bisgaard-itis added the a:apiserver api-server service label Jul 11, 2024
@bisgaard-itis bisgaard-itis added this to the Tom Bombadil milestone Jul 11, 2024
@bisgaard-itis bisgaard-itis self-assigned this Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:apiserver api-server service t:enhancement Improvement or request on an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants