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

Modified OutputBuffer to have an error function to output to stderr #264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FlyingPhish
Copy link

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.

@jtesta
Copy link
Owner

jtesta commented Jul 5, 2024

@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)
Copy link
Owner

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)
Copy link
Owner

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.

@jtesta
Copy link
Owner

jtesta commented Sep 24, 2024

@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!

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.

2 participants