File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -158,9 +158,9 @@ impl<F: RuntimeFactors> HttpServer<F> {
158158 addr. set_port ( addr. port ( ) + 1 ) ;
159159
160160 if !addr. port ( ) == u16:: MAX {
161- return Err ( anyhow:: anyhow !(
161+ anyhow:: bail !(
162162 "Couldn't find a free port as we've reached the maximum port number. Consider retrying with a lower base port."
163- ) ) ;
163+ ) ;
164164 }
165165
166166 match TcpListener :: bind ( addr) . await {
@@ -172,10 +172,7 @@ impl<F: RuntimeFactors> HttpServer<F> {
172172 if err. kind ( ) == ErrorKind :: AddrInUse {
173173 continue ;
174174 }
175- return Err ( anyhow:: anyhow!(
176- "Unable to listen on {}" ,
177- self . listen_addr
178- ) ) ;
175+ anyhow:: bail!( "Unable to listen on {}" , self . listen_addr) ;
179176 }
180177 }
181178 }
@@ -186,7 +183,7 @@ impl<F: RuntimeFactors> HttpServer<F> {
186183 self . listen_addr. port( ) + 9
187184 ) ) ?
188185 } else {
189- return Err ( anyhow:: anyhow !( "Unable to listen on {}. To have Spin search for a free port, use the --find-free-port option." , self . listen_addr) ) ;
186+ anyhow:: bail !( "Unable to listen on {}. To have Spin search for a free port, use the --find-free-port option." , self . listen_addr)
190187 }
191188 }
192189 } ;
You can’t perform that action at this time.
0 commit comments