[go: up one dir, main page]

check_success

Function check_success 

Source
pub async fn check_success<T: Response>(
    response: T,
    options: Option<CheckSuccessOptions>,
) -> Result<T>
Expand description

Checks if the response is a success and if not, creates an appropriate error.

§Arguments

  • response - The HTTP response to check.
  • options - Optional parameters to customize the success criteria.

§Returns

  • Ok(RawResponse) if the response is a success.
  • Err(Error) if the response is an error, with details extracted from the response body if possible.