-
Notifications
You must be signed in to change notification settings - Fork 12
Don't swallow text from nested errors #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,33 +30,33 @@ use tracing::instrument; | |||||
| #[derive(Error, Debug)] | ||||||
| #[non_exhaustive] | ||||||
| pub enum Error { | ||||||
| #[error("i/o error")] | ||||||
| #[error("i/o error: {0}")] | ||||||
| /// An input/output error | ||||||
| Io(#[from] std::io::Error), | ||||||
| #[error("skopeo spawn error: {}", .0)] | ||||||
| #[error("skopeo spawn error: {0}")] | ||||||
| /// An error spawning skopeo | ||||||
| SkopeoSpawnError(#[source] std::io::Error), | ||||||
| #[error("serialization error")] | ||||||
| #[error("serialization error: {0}")] | ||||||
| /// Returned when serialization or deserialization fails | ||||||
| SerDe(#[from] serde_json::Error), | ||||||
| /// The proxy failed to initiate a request | ||||||
| #[error("failed to invoke method {method}: {error}")] | ||||||
| RequestInitiationFailure { method: Box<str>, error: Box<str> }, | ||||||
| /// An error returned from the remote proxy | ||||||
| #[error("proxy request returned error")] | ||||||
| #[error("proxy request returned error: {0}")] | ||||||
| RequestReturned(Box<str>), | ||||||
| #[error("semantic version error")] | ||||||
| #[error("semantic version error: {0}")] | ||||||
| SemanticVersion(#[from] semver::Error), | ||||||
| #[error("proxy too old (requested={requested_version} found={found_version}) error")] | ||||||
| /// The proxy doesn't support the requested semantic version | ||||||
| ProxyTooOld { | ||||||
| requested_version: Box<str>, | ||||||
| found_version: Box<str>, | ||||||
| }, | ||||||
| #[error("configuration error")] | ||||||
| #[error("configuration error: {0}")] | ||||||
| /// Conflicting or missing configuration | ||||||
| Configuration(Box<str>), | ||||||
| #[error("error")] | ||||||
| #[error("other error: {0}")] | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For a general catch-all variant like
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm I would rather explicitly know that the error came from the |
||||||
| /// An unknown other error | ||||||
| Other(Box<str>), | ||||||
| } | ||||||
|
|
@@ -72,9 +72,9 @@ impl Error { | |||||
| #[non_exhaustive] | ||||||
| pub enum GetBlobError { | ||||||
| /// A client may reasonably retry on this type of error. | ||||||
| #[error("retryable error")] | ||||||
| #[error("retryable error: {0}")] | ||||||
| Retryable(Box<str>), | ||||||
| #[error("error")] | ||||||
| #[error("other error: {0}")] | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| /// An unknown other error | ||||||
| Other(Box<str>), | ||||||
| } | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.