Files
lighthouse/common/warp_utils/src/status_code.rs
Michael Sproul bdfade8e3d Consolidate reqwest versions (#8452)
Update `reqwest` to 0.12 so we only depend on a single version. This should slightly improve compile times and reduce binary bloat.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-11-24 22:39:40 +00:00

10 lines
336 B
Rust

use eth2::StatusCode;
use warp::Rejection;
/// Convert from a "new" `http::StatusCode` to a `warp` compatible one.
pub fn convert(code: StatusCode) -> Result<warp::http::StatusCode, Rejection> {
code.as_u16().try_into().map_err(|e| {
crate::reject::custom_server_error(format!("bad status code {code:?} - {e:?}"))
})
}