pub enum RestClientError {
Show 17 variants
DiffError(DiffError),
MalformedEventInfo(String),
Request(Error),
RequestContext {
task: String,
source: Error,
},
Io {
task: String,
source: Error,
},
GitCommand(String),
RateLimitNoReset,
RateLimitPrimary(DateTime<Utc>),
RateLimitSecondary,
CannotCloneRequest,
InvalidHeaderValue(InvalidHeaderValue),
UnexpectedHeaderValue(ToStrError),
HeaderParseInt(ParseIntError),
UrlParse(ParseError),
Json {
task: String,
source: Error,
},
EnvVar {
name: String,
source: VarError,
},
OutputVar(OutputVariableError),
}Expand description
The possible error emitted by the REST client API
Variants§
DiffError(DiffError)
file-changes only.Errors related to parsing git diffs.
MalformedEventInfo(String)
Error emitted when encountering malformed event information.
Request(Error)
Error related to making HTTP requests
RequestContext
Error related to making HTTP requests, with additional context about the request that caused the error.
Io
Errors related to standard I/O.
GitCommand(String)
file-changes only.Error related to git command execution.
RateLimitNoReset
Error related to exceeding REST API Rate limits and no reset time is provided in the response headers.
RateLimitPrimary(DateTime<Utc>)
Error related to exceeding REST API Rate limits with a known reset time.
RateLimitSecondary
Error related to exhausting all retries after hitting REST API Rate limits.
CannotCloneRequest
Error emitted when failing to clone a request object.
InvalidHeaderValue(InvalidHeaderValue)
Error emitted when failing to create a header value.
UnexpectedHeaderValue(ToStrError)
Error emitted when failing to convert a header value to string.
HeaderParseInt(ParseIntError)
Error emitted when failing to parse an integer from a header value (as a UTF-8 string).
UrlParse(ParseError)
Error emitted when failing to parse a URL.
Json
Error emitted when failing to deserialize/serialize request/response JSON data.
EnvVar
Error emitted when failing to read an environment variable.
Fields
OutputVar(OutputVariableError)
An error emitted when encountering an invalid OutputVariable.
Implementations§
Source§impl RestClientError
impl RestClientError
Sourcepub fn env_var(name: &str, source: VarError) -> Self
pub fn env_var(name: &str, source: VarError) -> Self
Helper function to create an Self::EnvVar error with variable name and source error.
Sourcepub fn io(task: &str, source: Error) -> Self
pub fn io(task: &str, source: Error) -> Self
Helper function to create an Self::Io error with task context.
Sourcepub fn add_request_context(self, task: &str) -> Self
pub fn add_request_context(self, task: &str) -> Self
Builder function to add context to Self::Request errors.
Returns a Self::RequestContext error if self is a Self::Request error.
Otherwise, returns self unchanged.
Sourcepub fn json(task: &str, source: Error) -> Self
pub fn json(task: &str, source: Error) -> Self
Helper function to create a Self::Json error with task context.
Trait Implementations§
Source§impl Debug for RestClientError
impl Debug for RestClientError
Source§impl Display for RestClientError
impl Display for RestClientError
Source§impl Error for RestClientError
impl Error for RestClientError
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<DiffError> for RestClientError
impl From<DiffError> for RestClientError
Source§impl From<Error> for RestClientError
impl From<Error> for RestClientError
Source§impl From<InvalidHeaderValue> for RestClientError
impl From<InvalidHeaderValue> for RestClientError
Source§fn from(source: InvalidHeaderValue) -> Self
fn from(source: InvalidHeaderValue) -> Self
Source§impl From<OutputVariableError> for RestClientError
impl From<OutputVariableError> for RestClientError
Source§fn from(source: OutputVariableError) -> Self
fn from(source: OutputVariableError) -> Self
Source§impl From<ParseError> for RestClientError
impl From<ParseError> for RestClientError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Source§impl From<ParseIntError> for RestClientError
impl From<ParseIntError> for RestClientError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Source§impl From<ToStrError> for RestClientError
impl From<ToStrError> for RestClientError
Source§fn from(source: ToStrError) -> Self
fn from(source: ToStrError) -> Self
Auto Trait Implementations§
impl Freeze for RestClientError
impl !RefUnwindSafe for RestClientError
impl Send for RestClientError
impl Sync for RestClientError
impl Unpin for RestClientError
impl UnsafeUnpin for RestClientError
impl !UnwindSafe for RestClientError
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.