pub enum UploadError {
Rejected {
status: StatusCode,
message: String,
},
Retryable {
message: String,
},
}Expand description
Why an upload failed, and whether sending the same bytes again could ever work.
The distinction is the server’s own (ADR 0005) and it is the whole reason
this is an enum rather than a message: 4xx means the payload will never
be accepted as sent, so a queue must stop asking; 5xx and 429 mean the
server could not answer this time, so it must keep the day and try later.
Variants§
Rejected
The server refused the payload itself. Retrying is pointless.
Retryable
The server could not answer, or answered that it was unavailable. The day is still worth sending.
Implementations§
Source§impl UploadError
impl UploadError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether sending this day again could succeed.
Trait Implementations§
Source§impl Debug for UploadError
impl Debug for UploadError
Source§impl Display for UploadError
impl Display for UploadError
Source§impl Error for UploadError
impl Error for UploadError
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 UploadError
impl RefUnwindSafe for UploadError
impl Send for UploadError
impl Sync for UploadError
impl Unpin for UploadError
impl UnsafeUnpin for UploadError
impl UnwindSafe for UploadError
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