IRL2 / nanover-rs

Other
0 stars 1 forks source link

Report an error early when the socket cannot be created #169

Closed jbarnoud closed 1 year ago

jbarnoud commented 1 year ago

PR #167 moves the creation of the socket toward the beggining of the program, before the ESSD server starts. This solves, at least partially, issue #165. However, the error that could occur if the socket could not be created was just unwraped. This commit replaces this call to unwrap by a return with a specialised variant of AppError. This prevents the server from crashing if the socket cannot be created (wrong binding address, port already in use, unauthorised port...) fixing a regression introduced in #167.