Skip to content

Commit

Permalink
Print a better error message on invalid listen
Browse files Browse the repository at this point in the history
Part of getting rid of unwraps.
  • Loading branch information
SpamapS committed Jun 22, 2024
1 parent 757c7f1 commit bd2d120
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rustygeard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ fn main() -> ExitCode {
.expect("default_value should ensure this");
env_logger::init();

info!("Binding to {}", listen);
let address = listen.parse().unwrap();
info!("Will listen at {}", listen);
let address = listen
.parse()
.expect("Anything passed to listen must parse into a SocketAddr");
#[cfg(feature = "tls")]
let tls = match matches.get_flag("tls") {
false => None,
Expand Down

0 comments on commit bd2d120

Please sign in to comment.