feagi_agent/sdk/common/
error.rs1use std::error::Error;
4use std::fmt::{Display, Formatter};
5
6#[derive(Debug, Clone)]
8pub enum FeagiAgentError {
9 AuthenticationFailed(String),
11 GeneralFailure(String),
13}
14
15impl Display for FeagiAgentError {
16 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
17 match self {
18 FeagiAgentError::AuthenticationFailed(msg) => {
19 write!(f, "FeagiAgentError: Authentication failed: {}", msg)
20 }
21 FeagiAgentError::GeneralFailure(msg) => {
22 write!(f, "FeagiAgentError: {}", msg)
23 }
24 }
25 }
26}
27
28impl Error for FeagiAgentError {
29 fn source(&self) -> Option<&(dyn Error + 'static)> {
30 None
31 }
32}