Skip to content

Commit 8ebfbd0

Browse files
committed
Cleaned up some error handling
1 parent d64adbb commit 8ebfbd0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

crates/pbs/src/routes/get_header.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ pub async fn handle_get_header<S: BuilderApiState, A: BuilderApi<S>>(
3838
let accept_types = get_accept_types(&req_headers).map_err(|e| {
3939
error!(%e, "error parsing accept header");
4040
PbsClientError::DecodeError(format!("error parsing accept header: {e}"))
41-
});
42-
if let Err(e) = accept_types {
43-
return Ok((StatusCode::BAD_REQUEST, e).into_response());
44-
}
45-
let accept_types = accept_types.unwrap();
41+
})?;
4642

4743
info!(ua, ms_into_slot, "new request");
4844

0 commit comments

Comments
 (0)