-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 error message when TCP check fails #1745
Conversation
Appveyor fail unrelated to your changes, re-running the build |
@@ -53,7 +53,8 @@ def _load_conf(self, instance): | |||
addr = socket.gethostbyname(url) | |||
socket_type = socket.AF_INET | |||
except Exception: | |||
raise BadConfException("URL: %s is not a correct IPv4, IPv6 or hostname" % addr) | |||
msg = "URL: %s is not a correct IPv4, IPv6 or hostname" % url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you use the string format
method instead of %
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I prefer .format()
but the line and the rest of the file was already %
, also with format it is over 79 characters. Let me know if you want me to split it up into multiple lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, we're trying to gradually consolidate the use of a more modern style across the codebase and I took the opportunity 😄
Line width is fine if under 120 chars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, merging!
What does this PR do?
Shows an error message instead of a traceback.
Motivation
I was getting a traceback because
addr
was not defined.Review checklist
no-changelog
label attachedAdditional Notes
Anything else we should know when reviewing?