We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 836546c + fcf8f93 commit 8201b41Copy full SHA for 8201b41
src/cmd/serve.rs
@@ -161,5 +161,12 @@ async fn serve(
161
let fallback_route = warp::fs::file(build_dir.join(file_404))
162
.map(|reply| warp::reply::with_status(reply, warp::http::StatusCode::NOT_FOUND));
163
let routes = livereload.or(book_route).or(fallback_route);
164
+
165
+ std::panic::set_hook(Box::new(move |panic_info| {
166
+ // exit if serve panics
167
+ error!("Unable to serve: {}", panic_info);
168
+ std::process::exit(1);
169
+ }));
170
171
warp::serve(routes).run(address).await;
172
}
0 commit comments