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

Refactor Exception System #392

Open
SteinRobert opened this issue May 13, 2023 · 0 comments
Open

Refactor Exception System #392

SteinRobert opened this issue May 13, 2023 · 0 comments
Labels
enhancement 🎉 New feature or request python Pull requests that update Python code

Comments

@SteinRobert
Copy link
Contributor

SteinRobert commented May 13, 2023

What is the new feature about?

Currently Gefyra raises several kinds of RuntimeError when something goes wrong.
It's a kind of generic approach we handle the RuntimeError somewhere in the top of the call stack, which then simply prints an error message.
This makes it pretty difficult to handle errors in our Docker Desktop extension, as well as in future other extensions.

I'd suggest, that we create something like this:

class GefyraException(RuntimeError):
    hint: str = ''
    code: int = None

So that we could output something like this:

Error: Pod not found.
Hint: Please check your-pod-name-123cx for typos.
Code: 100

Also gefyra-ext could then do something like this:

{"error": true, "msg": "Pod not found.", "hint": "Please check your-pod-name-123cx for typos.", "code": 100}

Why would such a feature be important to you?

Improve UX of Gefyra's CLI as well as other projects that build on top.

Anything else we need to know?

No response

@SteinRobert SteinRobert added enhancement 🎉 New feature or request python Pull requests that update Python code labels May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🎉 New feature or request python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

1 participant