pub enum DataGovError {
CatalogError(CatalogError),
HttpError(Error),
IoError(Error),
UrlError(ParseError),
ResourceNotFound {
message: String,
},
DownloadError {
message: String,
},
InvalidFormat {
expected: String,
actual: String,
},
ConfigError {
message: String,
},
ValidationError {
message: String,
},
Other {
message: String,
},
}Expand description
Errors that can occur when using the Data.gov client.
Variants§
CatalogError(CatalogError)
Error from the underlying Catalog API.
HttpError(Error)
HTTP request error.
IoError(Error)
File I/O error.
UrlError(ParseError)
Invalid URL error.
ResourceNotFound
Resource not found.
DownloadError
Download failed.
InvalidFormat
Invalid resource format.
ConfigError
Configuration error.
ValidationError
Validation error.
Other
Generic error with custom message.
Implementations§
Source§impl DataGovError
impl DataGovError
Sourcepub fn resource_not_found<S: Into<String>>(message: S) -> Self
pub fn resource_not_found<S: Into<String>>(message: S) -> Self
Create a new resource not found error.
Sourcepub fn download_error<S: Into<String>>(message: S) -> Self
pub fn download_error<S: Into<String>>(message: S) -> Self
Create a new download error.
Sourcepub fn config_error<S: Into<String>>(message: S) -> Self
pub fn config_error<S: Into<String>>(message: S) -> Self
Create a new configuration error.
Sourcepub fn validation_error<S: Into<String>>(message: S) -> Self
pub fn validation_error<S: Into<String>>(message: S) -> Self
Create a new validation error.
Sourcepub fn other<S: Into<String>>(message: S) -> Self
pub fn other<S: Into<String>>(message: S) -> Self
Create a generic error with a custom message.
Sourcepub fn sanitized_message(&self) -> String
pub fn sanitized_message(&self) -> String
Sanitize error message for external consumption.
Removes filesystem paths and other potentially sensitive information.
Trait Implementations§
Source§impl Debug for DataGovError
impl Debug for DataGovError
Source§impl Display for DataGovError
impl Display for DataGovError
Source§impl Error for DataGovError
impl Error for DataGovError
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()
Source§impl From<CatalogError> for DataGovError
impl From<CatalogError> for DataGovError
Source§fn from(source: CatalogError) -> Self
fn from(source: CatalogError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for DataGovError
impl From<Error> for DataGovError
Source§impl From<Error> for DataGovError
impl From<Error> for DataGovError
Source§impl From<ParseError> for DataGovError
impl From<ParseError> for DataGovError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for DataGovError
impl !UnwindSafe for DataGovError
impl Freeze for DataGovError
impl Send for DataGovError
impl Sync for DataGovError
impl Unpin for DataGovError
impl UnsafeUnpin for DataGovError
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
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.