map range-error to the right http error code #157

Merged
lx merged 4 commits from trinity-1686a/garage:range-error into main 2021-11-29 10:52:42 +00:00
Showing only changes of commit 8c45ad8e38 - Show all commits

View file

@ -90,6 +90,7 @@ impl Error {
Error::InternalError(_) | Error::Hyper(_) | Error::Http(_) => { Error::InternalError(_) | Error::Hyper(_) | Error::Http(_) => {
StatusCode::INTERNAL_SERVER_ERROR StatusCode::INTERNAL_SERVER_ERROR
} }
Error::InvalidRange(_) => StatusCode::RANGE_NOT_SATISFIABLE,
_ => StatusCode::BAD_REQUEST, _ => StatusCode::BAD_REQUEST,
} }
} }