pub enum CloudflareError {
MissingEnv {
env_var: &'static str,
hint: String,
},
Api {
code: u32,
message: String,
},
AuthRejected {
kind: AuthScope,
code: u32,
message: String,
},
NoDataArray,
Http(String),
}Variants§
MissingEnv
A required environment variable is missing or empty.
Api
Cloudflare returned an API error envelope (success: false).
AuthRejected
An authentication/authorization rejection classified by scope
(feedback 01): AuthScope::InvalidToken vs
AuthScope::WrongAccountScope vs AuthScope::WorkersAiPermission
are distinct, actionable failures. message is always token-scrubbed
before it reaches this variant.
NoDataArray
The OpenRouter-format response had no data array.
Http(String)
HTTP transport failure during a catalog or verify call.
Implementations§
Source§impl CloudflareError
impl CloudflareError
Sourcepub fn is_catalog_failure(&self) -> bool
pub fn is_catalog_failure(&self) -> bool
True when the error came from the catalog endpoint (fetch_models falls back to the static list on these).
Trait Implementations§
Source§impl Debug for CloudflareError
impl Debug for CloudflareError
Source§impl Display for CloudflareError
impl Display for CloudflareError
Source§impl Error for CloudflareError
impl Error for CloudflareError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for CloudflareError
impl RefUnwindSafe for CloudflareError
impl Send for CloudflareError
impl Sync for CloudflareError
impl Unpin for CloudflareError
impl UnsafeUnpin for CloudflareError
impl UnwindSafe for CloudflareError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more