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

Small error handling tweaks #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Small error handling tweaks #37

wants to merge 3 commits into from

Conversation

msm-cert
Copy link
Member

Slightly improve error handling (add two missing catches - non-numeric port and unknown RSA key type).

When swallowing an exception, at least log a warning.

@@ -230,21 +233,21 @@ def try_add_rsa_from_pem(self, pem: str) -> None:
if pem:
self.add_rsa_key(RsaKey.parse_pem(pem))
except IocExtractError:
pass
log.warn("Failed to parse a RSA key from PEM")
Copy link
Member

Choose a reason for hiding this comment

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

logging.warn is deprecated, we should use logging.warning



# Utils
class CantFindAHostForTheDomain(IocExtractError):
Copy link
Member

Choose a reason for hiding this comment

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

The exception name sounds a bit weird with the articles, maybe just CantFindHostForDomain? (same applies for other exceptions)

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.

3 participants