Skip to content

Commit

Permalink
api: add Error::JoinError
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Jul 4, 2023
1 parent a1aa336 commit 460cd31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = ["package-management"]
categories = ["command-line-utilities"]

include = ["LICENSE", "Cargo.toml", "src/**/*.rs", "build.rs"]
exclude = ["dist/**/*", "docs/**/*"]
# exclude = ["dist/**/*", "docs/**/*"]
# build = "build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
13 changes: 9 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use std::{
fmt::{self, Debug},
process::{ExitCode, Termination},
string::FromUtf8Error,
};

use thiserror::Error;
Expand All @@ -29,7 +30,7 @@ pub enum Error {
ConfigError(#[from] figment::Error),

/// A [`Cmd`](crate::exec::Cmd) failed to finish.
#[error("Failed to get exit code of subprocess: {0}")]
#[error("Failed to finish subprocess execution: {0}")]
CmdJoinError(JoinError),

/// A [`Cmd`](crate::exec::Cmd) failed to spawn.
Expand Down Expand Up @@ -57,18 +58,22 @@ pub enum Error {

/// Error while converting a [`Vec<u8>`] to a [`String`].
#[error(transparent)]
FromUtf8Error(#[from] std::string::FromUtf8Error),
FromUtf8Error(#[from] FromUtf8Error),

/// A non-specific [`io::Error`].
/// A generic [`io::Error`].
#[error(transparent)]
IoError(#[from] io::Error),

/// A generic [`JoinError`].
#[error(transparent)]
JoinError(#[from] JoinError),

/// A [`Pm`](crate::pm::Pm) operation is not implemented.
#[error("Operation `{op}` is unimplemented for `{pm}`")]
#[allow(missing_docs)]
OperationUnimplementedError { op: String, pm: String },

/// Miscellaneous other error.
/// An error from a non-specified category.
#[error("{0}")]
OtherError(String),
}
Expand Down

0 comments on commit 460cd31

Please sign in to comment.