/// Convert the error into an appropriate [`StatusCode`] to be returned to
/// the end user.
Convert the error into an appropriate [`StatusCode`] to be returned to
the end user.
Convert the error into an appropriate [ ` StatusCode ` ] to be returned to the end user .
pub fn as_status_code(&self) -> StatusCode {
        match self {
            Error::NoHandler => StatusCode::NOT_FOUND,
            Error::InvalidOrgBucket(_) => StatusCode::BAD_REQUEST,
            Error::ClientHangup(_) => StatusCode::BAD_REQUEST,
            Error::InvalidGzip(_) => StatusCode::BAD_REQUEST,
            Error::NonUtf8ContentHeader(_) => StatusCode::BAD_REQUEST,
            Error::NonUtf8Body(_) => StatusCode::BAD_REQUEST,
            Error::ParseLineProtocol(_) => StatusCode::BAD_REQUEST,
            Error::ParseDelete(_) => StatusCode::BAD_REQUEST,
            Error::RequestSizeExceeded(_) => StatusCode::PAYLOAD_TOO_LARGE,
            Error::InvalidContentEncoding(_) => {
                // https://www.rfc-editor.org/rfc/rfc7231#section-6.5.13
                StatusCode::UNSUPPORTED_MEDIA_TYPE
            }
            Error::DmlHandler(err) => StatusCode::from(err),
            Error::RequestLimit => StatusCode::SERVICE_UNAVAILABLE,
        }
    }
pub fn as_status_code ( & self ) -> StatusCode { match self { Error :: NoHandler => StatusCode :: NOT_FOUND , Error :: InvalidOrgBucket ( _ ) => StatusCode :: BAD_REQUEST , Error :: ClientHangup ( _ ) => StatusCode :: BAD_REQUEST , Error :: InvalidGzip ( _ ) => StatusCode :: BAD_REQUEST , Error :: NonUtf8ContentHeader ( _ ) => StatusCode :: BAD_REQUEST , Error :: NonUtf8Body ( _ ) => StatusCode :: BAD_REQUEST , Error :: ParseLineProtocol ( _ ) => StatusCode :: BAD_REQUEST , Error :: ParseDelete ( _ ) => StatusCode :: BAD_REQUEST , Error :: RequestSizeExceeded ( _ ) => StatusCode :: PAYLOAD_TOO_LARGE , Error :: InvalidContentEncoding ( _ ) => { // https://www.rfc-editor.org/rfc/rfc7231#section-6.5.13 StatusCode :: UNSUPPORTED_MEDIA_TYPE } Error :: DmlHandler ( err ) => StatusCode :: from ( err ) , Error :: RequestLimit => StatusCode :: SERVICE_UNAVAILABLE , } }
Convert the error into an appropriate [`StatusCode`] to be returned to
the end user.
Convert the error into an appropriate [ ` StatusCode ` ] to be returned to the end user .
&self