Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

643 B
Raw Blame
use reqwest::StatusCode;
use thiserror::Error;

use crate::prelude::ApiError;

#[derive(Debug, Error)]
pub enum AnthropicError {
    /// An error sent by anthropic
    #[error("Error returned from stream")]
    StreamError(String),
    /// Stream closed unexpectedly
    #[error("Invalid json returned from stream")]
    JsonDeserialize(serde_json::Error),
    /// error from reqwest
    #[error("http error")]
    Reqwest(#[from] reqwest::Error),
    #[error("API returned a bad status code")]
    ApiError {
        api_error: ApiError,
        status_code: StatusCode,
    },
}

pub type Result<T> = std::result::Result<T, AnthropicError>;