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

fix(#26): gracefully quit on auth failures in hstorm #36

Merged
merged 1 commit into from
May 16, 2024

Conversation

gormaniac
Copy link
Owner

This PR does two things to gracefully exit on auth failures in hstorm:

  1. Changes the HttpCortex.login method. It moves the original login functionality to a new method, _login, which the new login method calls. It also adds an optional close argument to the new login method, that defaults to False. When True, HttpCortex.stop is called when _login raises an exception, then login reraises that exception. This new argument is set to True in the HttpCortex.__aenter__ method's login call.
  2. A try/except is added to hstorm.main around the HttpCortex call and catches HttpCortexLoginError errors. This way only the error message is printed upon a login error.

@gormaniac gormaniac self-assigned this May 16, 2024
@gormaniac gormaniac merged commit 4979fa7 into main May 16, 2024
@gormaniac gormaniac deleted the fix-hstorm-login branch May 16, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant