-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fail the app when binding to a port fails #218
base: main
Are you sure you want to change the base?
Conversation
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.
These are suggestions I have for the betterment of the user experience, I hope you agree they are worthwhile changes.
Thanks!
tests/service/mod.rs
Outdated
let (tcp_socket, udp_socket) = match Server::bind(ip.ip()).await { | ||
Ok(x) => x, | ||
Err(_) => { | ||
panic!("Could not bind port"); |
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.
might be better to change the sig of the return value to return Result<Vec<_>, anyhow::Error>
so the original error doesn't get swallowed.
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.
Took a stab at that but then I'd have to change the signature Service::new
and then of every test, so...
People running zeronsd tests can figure it out :)
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.
I'm not sure that's the best way, but I won't argue with you. :P
7c59e43
to
9a75376
Compare
Thanks. I couldn't get that to work for some reason and you motivated me to fix it. Now it makes errors that look like this:
|
tokio is was eating the panics and continuing on with no socket listening on 53 making tokio crash would take a bunch of rewrite i think, so i moved the `bind` calls out to a different, non-async fn
9a75376
to
7a67efa
Compare
Glad to be of help! I hadn't used |
tokio is was eating the panics and continuing on
with no socket listening on 53
making tokio crash would take a bunch of rewrite,
i think, so i moved the
bind
calls out to a different fnThe error looks like this: