[−][src]Struct nakadion::components::connector::NakadiApiError
An error type to get insights on why an HTTP request failed
Implementations
impl NakadiApiError
[src]
pub fn http<T: Into<StatusCode>>(status: T) -> Self
[src]
Create an response based error from a StatusCode
received
from a server
pub fn io() -> Self
[src]
Create an io based error.
pub fn other() -> Self
[src]
Create an error for some other cause
pub fn http_problem<T: Into<HttpApiProblem>>(prob: T) -> Self
[src]
Create an error from an HttpApiProblem
.
Keep in mind that an HttpApiProblem
can also be created
from a StatusCode
but in that case you should prefer
NakadiApiError::http
.
This will also set the HttpApiProblem
as the cause for this error.
pub fn caused_by<E>(mut self: Self, err: E) -> Self where
E: StdError + Send + Sync + 'static,
[src]
E: StdError + Send + Sync + 'static,
Add a cause to this error
pub fn with_context<T: Into<String>>(mut self: Self, context: T) -> Self
[src]
Add a message that adds context to the cause for this error.
pub fn with_flow_id<T: Into<FlowId>>(mut self: Self, flow_id: T) -> Self
[src]
Add a FlowId
to this error
pub fn with_maybe_flow_id(mut self: Self, flow_id: Option<FlowId>) -> Self
[src]
pub fn flow_id(&self) -> Option<&FlowId>
[src]
Returns the FlowId
associated with this error
pub fn problem(&self) -> Option<&HttpApiProblem>
[src]
Returns the HttpApiProblem
associated with this error
if the cause of this error was an HttpApiProblem
If the cause was not an HttpApiProblem
None
is
returned.
pub fn try_into_problem(mut self: Self) -> Result<HttpApiProblem, Self>
[src]
Try to turn this error into an HttpApiProblem
.
If the cause was not an HttpApiProblem
Self
is
returned as an error.
pub fn status(&self) -> Option<StatusCode>
[src]
Get the HttpStatusCode
for this error if there
is a status code associated with this error
pub fn is_client_error(&self) -> bool
[src]
Returns true if there is a StatusCode
and if it is a client error.
pub fn is_auth_error(&self) -> bool
[src]
Returns true if there is a StatusCode
and if it StatusCode::FORBIDDEN
or StatusCode::UNAUTHORIZED
.
pub fn is_server_error(&self) -> bool
[src]
Returns true if there is a StatusCode
and if it is a server error.
pub fn is_other_error(&self) -> bool
[src]
Returns true if the error was created with NakadiApiError::other
.
pub fn is_io_error(&self) -> bool
[src]
Returns true if the error was created with NakadiApiError::io
.
Trait Implementations
impl Debug for NakadiApiError
[src]
impl Display for NakadiApiError
[src]
impl Error for NakadiApiError
[src]
pub fn source(&self) -> Option<&(dyn StdError + 'static)>
[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<Elapsed> for NakadiApiError
[src]
impl From<Error> for NakadiApiError
[src]
impl From<InvalidHeaderValue> for NakadiApiError
[src]
pub fn from(err: InvalidHeaderValue) -> Self
[src]
impl From<InvalidUri> for NakadiApiError
[src]
pub fn from(err: InvalidUri) -> Self
[src]
impl From<IoError> for NakadiApiError
[src]
impl From<NakadiApiError> for Error
[src]
pub fn from(err: NakadiApiError) -> Self
[src]
impl From<NakadiApiError> for PublishError
[src]
pub fn from(api_error: NakadiApiError) -> Self
[src]
impl From<NakadiApiError> for CommitError
[src]
pub fn from(api_error: NakadiApiError) -> Self
[src]
impl From<NakadiApiError> for ConnectError
[src]
pub fn from(api_error: NakadiApiError) -> Self
[src]
impl From<RemoteCallError> for NakadiApiError
[src]
pub fn from(err: RemoteCallError) -> Self
[src]
impl From<TokenError> for NakadiApiError
[src]
pub fn from(err: TokenError) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for NakadiApiError
[src]
impl Send for NakadiApiError
[src]
impl Sync for NakadiApiError
[src]
impl Unpin for NakadiApiError
[src]
impl !UnwindSafe for NakadiApiError
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,