Skip to content

Commit

Permalink
chore: maintain structure of errors in CliError (#1004)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Mar 18, 2023
1 parent 8dc6352 commit a700ee9
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions crates/nargo/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,16 @@ pub(crate) enum CliError {
/// Error while compiling Noir into ACIR.
#[error("Failed to compile circuit")]
CompilationError,
}

impl From<OpcodeResolutionError> for CliError {
fn from(value: OpcodeResolutionError) -> Self {
CliError::Generic(value.to_string())
}
}
/// Input parsing error
#[error(transparent)]
InputParserError(#[from] InputParserError),

impl From<InputParserError> for CliError {
fn from(error: InputParserError) -> Self {
CliError::Generic(error.to_string())
}
}
/// ABI encoding/decoding error
#[error(transparent)]
AbiError(#[from] AbiError),

impl From<AbiError> for CliError {
fn from(error: AbiError) -> Self {
CliError::Generic(error.to_string())
}
/// ACIR circuit solving error
#[error(transparent)]
SolvingError(#[from] OpcodeResolutionError),
}

0 comments on commit a700ee9

Please sign in to comment.