You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for_status takes any HTTP status code as an input, but it unconditionally passes the code to for_client_error, which asserts that the status is 400-level:
I have some error handling code that's tripping this assert: it calls an external service, gets back a Progenitor result, checks to see if the result contains a status, and if so passes that status to HttpError::for_status to re-encode it as an HTTP error. If there's a more idiomatic way to do this specific conversion, that'd be great too, but it seems strange that for_status theoretically allows any status but will explode on a subset of them.
The text was updated successfully, but these errors were encountered:
for_status
takes any HTTP status code as an input, but it unconditionally passes the code tofor_client_error
, which asserts that the status is 400-level:dropshot/dropshot/src/error.rs
Lines 204 to 215 in c719b41
dropshot/dropshot/src/error.rs
Lines 143 to 155 in c719b41
I have some error handling code that's tripping this assert: it calls an external service, gets back a Progenitor result, checks to see if the result contains a status, and if so passes that status to
HttpError::for_status
to re-encode it as an HTTP error. If there's a more idiomatic way to do this specific conversion, that'd be great too, but it seems strange thatfor_status
theoretically allows any status but will explode on a subset of them.The text was updated successfully, but these errors were encountered: