pub enum GoError {
ParseError {
source: Box<dyn Error + Send + Sync>,
},
InvalidVersionSpecifier {
specifier: String,
message: String,
},
ModuleNotFound {
module: String,
},
RegistryError {
module: String,
source: Box<dyn Error + Send + Sync>,
},
CacheError(String),
InvalidModulePath(String),
InvalidPseudoVersion {
version: String,
reason: String,
},
ApiResponseError {
module: String,
source: Error,
},
Io(Error),
Other(Box<dyn Error + Send + Sync>),
}Expand description
Errors that can occur during Go module operations.
Variants§
ParseError
Failed to parse go.mod file
InvalidVersionSpecifier
Invalid version specifier
ModuleNotFound
Module not found in registry
RegistryError
Registry request failed
CacheError(String)
Cache error
InvalidModulePath(String)
Invalid module path
InvalidPseudoVersion
Invalid pseudo-version format
ApiResponseError
Failed to deserialize proxy.golang.org API response
Io(Error)
I/O error
Other(Box<dyn Error + Send + Sync>)
Generic error wrapper
Implementations§
Source§impl GoError
impl GoError
Sourcepub fn registry_error(
module: impl Into<String>,
error: impl Error + Send + Sync + 'static,
) -> Self
pub fn registry_error( module: impl Into<String>, error: impl Error + Send + Sync + 'static, ) -> Self
Helper for creating registry errors
Sourcepub fn invalid_version_specifier(
specifier: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn invalid_version_specifier( specifier: impl Into<String>, message: impl Into<String>, ) -> Self
Helper for creating invalid version specifier errors
Sourcepub fn module_not_found(module: impl Into<String>) -> Self
pub fn module_not_found(module: impl Into<String>) -> Self
Helper for creating module not found errors
Trait Implementations§
Source§impl Error for GoError
impl Error for GoError
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 GoError
impl !RefUnwindSafe for GoError
impl Send for GoError
impl Sync for GoError
impl Unpin for GoError
impl !UnwindSafe for GoError
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.