-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Modified OutputBuffer to have an error function to output to stderr #264
base: master
Are you sure you want to change the base?
Conversation
…Change .fail with errors to .error
@FlyingPhish : I provided feedback on some of your proposed changes. Looks good otherwise. |
@@ -108,7 +108,8 @@ def listen_and_accept(self) -> None: | |||
s.listen() | |||
self.__sock_map[s.fileno()] = s | |||
except Exception as e: | |||
print("Warning: failed to listen on any IPv4 interfaces: %s" % str(e)) | |||
self.__outputbuffer.error("Warning: failed to listen on any IPv4 interfaces: %s" % str(e)) | |||
sys.exit(exitcodes.CONNECTION_ERROR) |
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.
Calling sys.exit()
wouldn't be appropriate since this is a warning condition, not an error.
@@ -119,11 +120,12 @@ def listen_and_accept(self) -> None: | |||
s.listen() | |||
self.__sock_map[s.fileno()] = s | |||
except Exception as e: | |||
print("Warning: failed to listen on any IPv6 interfaces: %s" % str(e)) | |||
self.__outputbuffer.error("Warning: failed to listen on any IPv6 interfaces: %s" % str(e)) | |||
sys.exit(exitcodes.CONNECTION_ERROR) |
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.
Similar to above, this is not a hard error, so calling sys.exit()
isn't appropriate.
@FlyingPhish: if you're able to make the minor changes I requested in the review, and resolve the merge conflict, I can go ahead and merge this. Thanks! |
Added error function to OutputBuffer to output errors to stderr, then changed a bunch of .fails where the values were error: or [exception].
Have tested and code appears to work as intended.