async fn check_status(resp: reqwest::Response) -> Result<(), Box<dyn std::error::Error>> {
    let status = resp.status().as_u16();
    if (200..300).contains(&status) {
        Ok(())
    } else {
        let body = resp.text().await.unwrap_or_default();
        Err(Box::new(Error::Cx(format!(
            "Logging Error: status:{} {}",
            status, body
        ))))
    }
}
// Error handling for Coralogix
// Instead of just returning error for non-2xx status (via resp.error_for_status)
// include response body which may have additional diagnostic info
Error handling for Coralogix
Instead of just returning error for non-2xx status (via resp.error_for_status)
include response body which may have additional diagnostic info
Error handling for Coralogix Instead of just returning error for non - 2xx status ( via resp . error_for_status ) include response body which may have additional diagnostic info
async fn check_status(resp: reqwest::Response) -> Result<(), Box<dyn std::error::Error>> {
    let status = resp.status().as_u16();
    if (200..300).contains(&status) {
        Ok(())
    } else {
        let body = resp.text().await.unwrap_or_default();
        Err(Box::new(Error::Cx(format!(
            "Logging Error: status:{} {}",
            status, body
        ))))
    }
}
async fn check_status ( resp : reqwest :: Response ) -> Result < ( ) , Box < dyn std :: error :: Error > > { let status = resp . status ( ) . as_u16 ( ) ; if ( 200 .. 300 ) . contains ( & status ) { Ok ( ( ) ) } else { let body = resp . text ( ) . await . unwrap_or_default ( ) ; Err ( Box :: new ( Error :: Cx ( format ! ( " " status body ) ) ) ) } }
Error handling for Coralogix
Instead of just returning error for non-2xx status (via resp.error_for_status)
include response body which may have additional diagnostic info
Error handling for Coralogix Instead of just returning error for non - 2xx status ( via resp . error_for_status ) include response body which may have additional diagnostic info
resp
reqwest::Response
resp
reqwest::Response