pub enum BrazeApiError {
Http {
status: StatusCode,
body: String,
},
Network(Error),
Unauthorized,
NotFound {
resource: String,
},
RateLimitExhausted,
PaginationNotImplemented {
endpoint: &'static str,
detail: String,
},
UnexpectedApiMessage {
endpoint: &'static str,
message: String,
},
DuplicateNameInListResponse {
endpoint: &'static str,
name: String,
},
}Variants§
Http
Non-success HTTP status that wasn’t already mapped to a typed variant below. Carries the body so users have something to grep.
Network(Error)
Network / decode errors from reqwest. Includes JSON parse errors
(reqwest::Error::is_decode) — the message will say so.
401 from Braze. Almost always a wrong / missing API key.
NotFound
404 mapped from a get-by-name endpoint. Generic Http {404} from a list endpoint stays as Http; this variant is reserved for the “this specific resource doesn’t exist” case so callers can branch on it without string matching.
RateLimitExhausted
MAX_RETRIES of 429 in a row. The caller should slow down (or raise the configured rate limit) rather than just retrying again.
PaginationNotImplemented
A list endpoint returned a truncated page and v0.2.0 does not yet
implement pagination. Returned instead of silently dropping the
missing results, because for content blocks that drop would let
apply create duplicates of blocks living on page 2+ (and
--archive-orphans would miss them entirely).
UnexpectedApiMessage
Braze returned HTTP 200 with a non-success message field that
does not match any known not-found phrase. Surfaced verbatim so
an unexpected server-side failure is loud instead of being
silently misclassified as NotFound — the wire shapes in v0.2.0
are ASSUMED per IMPLEMENTATION.md §8.3, so any unrecognised
status message is exactly the signal the operator needs to see.
DuplicateNameInListResponse
A list endpoint returned two entries sharing the same name.
Braze is expected to enforce name uniqueness for named resources
(content blocks, email templates), so this is a contract
violation rather than an operator-fixable condition. We surface
it loudly because the diff/apply path indexes by name — silently
keeping only one of a duplicate pair would hide a resource from
every subsequent list/update/archive operation.
Trait Implementations§
Source§impl Debug for BrazeApiError
impl Debug for BrazeApiError
Source§impl Display for BrazeApiError
impl Display for BrazeApiError
Source§impl Error for BrazeApiError
impl Error for BrazeApiError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<BrazeApiError> for Error
impl From<BrazeApiError> for Error
Source§fn from(source: BrazeApiError) -> Self
fn from(source: BrazeApiError) -> Self
Auto Trait Implementations§
impl Freeze for BrazeApiError
impl !RefUnwindSafe for BrazeApiError
impl Send for BrazeApiError
impl Sync for BrazeApiError
impl Unpin for BrazeApiError
impl UnsafeUnpin for BrazeApiError
impl !UnwindSafe for BrazeApiError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.