#[non_exhaustive]pub enum NifiError {
Show 13 variants
Http {
source: Error,
},
InvalidBaseUrl {
source: ParseError,
},
Auth {
message: String,
},
InvalidCertificate {
source: Error,
},
Unauthorized {
message: String,
},
Forbidden {
message: String,
},
NotFound {
message: String,
},
Conflict {
message: String,
},
Api {
status: u16,
message: String,
},
UnsupportedVersion {
detected: String,
},
UnsupportedEndpoint {
endpoint: String,
version: String,
},
UnsupportedEnumVariant {
variant: String,
type_name: String,
version: String,
},
MissingRequiredField {
field: String,
type_name: String,
version: String,
},
}Expand description
All errors that can be returned by the NiFi client.
Variants are #[non_exhaustive] — new variants may be added in future releases.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Http
An underlying HTTP transport error from reqwest.
InvalidBaseUrl
The base URL provided to NifiClientBuilder could not be parsed.
Fields
source: ParseErrorThe underlying URL parse error.
Auth
Authentication against the NiFi /access/token endpoint failed.
InvalidCertificate
A custom CA certificate or client certificate could not be loaded.
The NiFi server returned HTTP 401 — credentials are missing or expired.
Fields
The error message returned by NiFi.
Forbidden
The NiFi server returned HTTP 403 — the authenticated user lacks permission.
NotFound
The NiFi server returned HTTP 404 — the requested resource does not exist.
Conflict
The NiFi server returned HTTP 409 — the request conflicts with current state.
Api
The NiFi server returned an unexpected non-2xx HTTP status code.
UnsupportedVersion
The detected NiFi version is not compiled into this client build.
Enable the matching nifi-x-y-z feature flag or use the dynamic feature.
UnsupportedEndpoint
The requested endpoint does not exist in the active NiFi version.
Occurs in dynamic mode when the server version predates a given endpoint.
Fields
UnsupportedEnumVariant
A response enum field contained a variant not known to this client build.
Fields
MissingRequiredField
A required field was absent when converting a dynamic response to a typed struct.
Implementations§
Source§impl NifiError
impl NifiError
Sourcepub fn status_code(&self) -> Option<u16>
pub fn status_code(&self) -> Option<u16>
Returns the HTTP status code if this is an API error variant.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
True if this error is likely transient and worth retrying.
Trait Implementations§
Source§impl Error for NifiError
impl Error for NifiError
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 ErrorCompat for NifiError
impl ErrorCompat for NifiError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source. Read moreAuto Trait Implementations§
impl Freeze for NifiError
impl !RefUnwindSafe for NifiError
impl Send for NifiError
impl Sync for NifiError
impl Unpin for NifiError
impl UnsafeUnpin for NifiError
impl !UnwindSafe for NifiError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
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.