pub fn as_status_code(&self) -> StatusCode {
        match self {
            Error::NoHandler | Error::DmlHandler(DmlError::DatabaseNotFound(_)) => {
                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::InvalidContentEncoding(_) => {
                // https://www.rfc-editor.org/rfc/rfc7231#section-6.5.13
                StatusCode::UNSUPPORTED_MEDIA_TYPE
            }
            Error::RequestSizeExceeded(_) => StatusCode::PAYLOAD_TOO_LARGE,
            Error::ParseLineProtocol(_) => StatusCode::BAD_REQUEST,
            Error::DmlHandler(DmlError::Internal(_)) => StatusCode::INTERNAL_SERVER_ERROR,
            Error::ParseDelete(_) => StatusCode::BAD_REQUEST,
        }
    }
/// 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 | Error::DmlHandler(DmlError::DatabaseNotFound(_)) => {
                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::InvalidContentEncoding(_) => {
                // https://www.rfc-editor.org/rfc/rfc7231#section-6.5.13
                StatusCode::UNSUPPORTED_MEDIA_TYPE
            }
            Error::RequestSizeExceeded(_) => StatusCode::PAYLOAD_TOO_LARGE,
            Error::ParseLineProtocol(_) => StatusCode::BAD_REQUEST,
            Error::DmlHandler(DmlError::Internal(_)) => StatusCode::INTERNAL_SERVER_ERROR,
            Error::ParseDelete(_) => StatusCode::BAD_REQUEST,
        }
    }
pub fn as_status_code ( & self ) -> StatusCode { match self { Error :: NoHandler | Error :: DmlHandler ( DmlError :: DatabaseNotFound ( _ ) ) => { 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 :: InvalidContentEncoding ( _ ) => { // https://www.rfc-editor.org/rfc/rfc7231#section-6.5.13 StatusCode :: UNSUPPORTED_MEDIA_TYPE } Error :: RequestSizeExceeded ( _ ) => StatusCode :: PAYLOAD_TOO_LARGE , Error :: ParseLineProtocol ( _ ) => StatusCode :: BAD_REQUEST , Error :: DmlHandler ( DmlError :: Internal ( _ ) ) => StatusCode :: INTERNAL_SERVER_ERROR , Error :: ParseDelete ( _ ) => StatusCode :: BAD_REQUEST , } }
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
&self