error.rs
This file
Path
src/error.rs
52 lines · 2.0 KiB · Rust
Last changed by
New parameter moduleDavid Peterbefore adoption47091a5
History of this fileTake it
New parameter moduleDavid Peterbefore adoption47091a5
line 1why, one step back1use std::num::{self, ParseIntError};Re-order importsDavid Peterbefore adoption9df6174
lines 2–3why, one step back23use rust_decimal::Error as DecimalError;Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 4why, one step back4use thiserror::Error;Flat directory/module structureDavid Peterbefore adoption30c381f
line 5why, one step back5Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 6why, one step back6#[derive(Debug, Error)]Flat directory/module structureDavid Peterbefore adoption30c381f
line 7why, one step back7pub enum ParameterScanError {Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 8why, one step back8 #[error("Error while parsing parameter scan arguments ({0})")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 9why, one step back9 ParseIntError(num::ParseIntError),Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 10why, one step back10 #[error("Error while parsing parameter scan arguments ({0})")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 11why, one step back11 ParseDecimalError(DecimalError),Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 12why, one step back12 #[error("Empty parameter range")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 13why, one step back13 EmptyRange,Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 14why, one step back14 #[error("Parameter range is too large")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 15why, one step back15 TooLarge,Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 16why, one step back16 #[error("Zero is not a valid parameter step")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 17why, one step back17 ZeroStep,Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 18why, one step back18 #[error("A step size is required when the range bounds are floating point numbers. The step size can be specified with the '--parameter-step-size' parameter")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 19why, one step back19 StepRequired,Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 20why, one step back20 #[error("'--command-name' has been specified {0} times. It has to appear exactly once, or exactly {1} times (number of benchmarks)")]Flat directory/module structureDavid Peterbefore adoption30c381f
lines 21–35why, one step back21 UnexpectedCommandNameCount(usize, usize),22}2324impl From<num::ParseIntError> for ParameterScanError {25 fn from(e: num::ParseIntError) -> ParameterScanError {26 ParameterScanError::ParseIntError(e)27 }28}2930impl From<DecimalError> for ParameterScanError {31 fn from(e: DecimalError) -> ParameterScanError {32 ParameterScanError::ParseDecimalError(e)33 }34}35Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 36why, one step back36#[derive(Debug, Error)]Flat directory/module structureDavid Peterbefore adoption30c381f
line 37why, one step back37pub enum OptionsError<'a> {Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
lines 38–40why, one step back38 #[error(39 "Conflicting requirements for the number of runs (empty range, min is larger than max)"40 )]Flat directory/module structureDavid Peterbefore adoption30c381f
line 41why, one step back41 EmptyRunsRange,Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 42why, one step back42 #[error("Too many --command-name options: Expected {0} at most")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 43why, one step back43 TooManyCommandNames(usize),Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 44why, one step back44 #[error("'--command-name' has been specified {0} times. It has to appear exactly once, or exactly {1} times (number of benchmarks)")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 45why, one step back45 UnexpectedCommandNameCount(usize, usize),Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 46why, one step back46 #[error("Could not read numeric argument to '--{0}': {1}")]Flat directory/module structureDavid Peterbefore adoption30c381f
line 47why, one step back47 NumericParsingError(&'a str, ParseIntError),Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 48why, one step back48 #[error("An empty command has been specified for the '--shell <command>' option")]Parse --shell option value as shell commandrhysdbefore adoptione2fdace
line 49why, one step back49 EmptyShell,Use thiserror for to derive ErrorDavid Peterbefore adoptionce7087b
line 50why, one step back50 #[error("Failed to parse '--shell <command>' expression as command line: {0}")]Parse --shell option value as shell commandrhysdbefore adoptione2fdace
line 51why, one step back51 ShellParseError(shell_words::ParseError),Flat directory/module structureDavid Peterbefore adoption30c381f
line 52why, one step back52}