pub enum TrackerError {
NotConfigured,
Unauthorized,
Rejected(String),
Transient {
retry_after: Option<Duration>,
},
}Expand description
Tracker failures.
NotConfigured is an error, not an outcome:
unlike Push — where “not configured” is a
PushOutcome a caller can degrade around —
Tracker answers Result<Filed, TrackerError>, and the venture code
that files a ticket needs to know nobody is listening rather than be
told it succeeded. PaymentsError::NotConfigured
is the precedent.
The two variants that carry a message are sanitized in Display the
way PushError’s are (issue #235): what an adapter
wraps is the tracker’s own words, and a webhook URL or a workspace name
is exactly the kind of value that rides in them. Display therefore
runs it through crate::logging::scrub_text; Debug still shows the
raw string for tests.
Variants§
NotConfigured
No tracker adapter is configured for this destination, or the adapter has no credential: the caller should degrade, not fail.
The tracker refused the credential: the per-tenant token was
wrong, expired, or lacked the scope the call needed (401/403),
so no retry and no redraft helps — a new credential has to be
issued. Distinct from Rejected, which is the
tracker refusing the ticket (a 4xx about the request, not
about who made it); conflating the two either pages on a bad draft
or files nothing while a tenant’s token sits expired.
Rejected(String)
The tracker refused the call — the destination was wrong, the
draft was rejected (4xx), or the adapter does not serve this
destination; not retryable without a change.
Transient
A transient failure (a 5xx, a 429, a transport error): retry
later, and not before retry_after when the provider named a
delay.
Implementations§
Source§impl TrackerError
impl TrackerError
Sourcepub fn unsupported_destination(dest: &Destination) -> Self
pub fn unsupported_destination(dest: &Destination) -> Self
The rejection an adapter returns for a destination kind it does not
serve. RoutingTracker exists so a venture never has to see this.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
How long the provider asked the caller to wait, where it said.
Trait Implementations§
Source§impl Clone for TrackerError
impl Clone for TrackerError
Source§impl Debug for TrackerError
impl Debug for TrackerError
Source§impl Display for TrackerError
impl Display for TrackerError
impl Eq for TrackerError
Source§impl Error for TrackerError
impl Error for TrackerError
1.30.0 · 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 PartialEq for TrackerError
impl PartialEq for TrackerError
impl StructuralPartialEq for TrackerError
Auto Trait Implementations§
impl Freeze for TrackerError
impl RefUnwindSafe for TrackerError
impl Send for TrackerError
impl Sync for TrackerError
impl Unpin for TrackerError
impl UnsafeUnpin for TrackerError
impl UnwindSafe for TrackerError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.