error.rs
This file
Path
src/error.rs
58 lines · 2.4 KiB · Rust
Last changed by
Added --stdin-data argumentSteve Neasebefore adoptione38acdb
History of this fileTake it
The walk stopped after 200 commits: lines older than b54b2f8 point at it.
Add new (hidden) --min-benchmarking-time optionDavid Peterbefore adoptiondffbdc3
line 1why, one step back1use std::num::{self, ParseFloatError, ParseIntError};Rename to OptionsDavid Peterbefore adoptionb54b2f8
lines 2–17why, one step back23use rust_decimal::Error as DecimalError;4use thiserror::Error;56#[derive(Debug, Error)]7pub enum ParameterScanError {8 #[error("Error while parsing parameter scan arguments ({0})")]9 ParseIntError(num::ParseIntError),10 #[error("Error while parsing parameter scan arguments ({0})")]11 ParseDecimalError(DecimalError),12 #[error("Empty parameter range")]13 EmptyRange,14 #[error("Parameter range is too large")]15 TooLarge,16 #[error("Zero is not a valid parameter step")]17 ZeroStep,Improve error messageDavid Peterbefore adoptiond3c7c79
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 '-D/--parameter-step-size <DELTA>' parameter")]Rename to OptionsDavid Peterbefore adoptionb54b2f8
lines 19–45why, one step back19 StepRequired,20 #[error("'--command-name' has been specified {0} times. It has to appear exactly once, or exactly {1} times (number of benchmarks)")]21 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}3536#[derive(Debug, Error)]37pub enum OptionsError<'a> {38 #[error(39 "Conflicting requirements for the number of runs (empty range, min is larger than max)"40 )]41 EmptyRunsRange,42 #[error("Too many --command-name options: Expected {0} at most")]43 TooManyCommandNames(usize),44 #[error("'--command-name' has been specified {0} times. It has to appear exactly once, or exactly {1} times (number of benchmarks)")]45 UnexpectedCommandNameCount(usize, usize),Add new (hidden) --min-benchmarking-time optionDavid Peterbefore adoptiondffbdc3
lines 46–49why, one step back46 #[error("Could not read numeric integer argument to '--{0}': {1}")]47 IntParsingError(&'a str, ParseIntError),48 #[error("Could not read numeric floating point argument to '--{0}': {1}")]49 FloatParsingError(&'a str, ParseFloatError),Rename to OptionsDavid Peterbefore adoptionb54b2f8
lines 50–53why, one step back50 #[error("An empty command has been specified for the '--shell <command>' option")]51 EmptyShell,52 #[error("Failed to parse '--shell <command>' expression as command line: {0}")]53 ShellParseError(shell_words::ParseError),Address review commentsTavian Barnesbefore adoption3df63ba
line 54why, one step back54 #[error("Unknown output policy '{0}'. Use './{0}' to output to a file named '{0}'.")]Forbid --output=file without a path separatorTavian Barnesbefore adoptionefdf735
line 55why, one step back55 UnknownOutputPolicy(String),Added --stdin-data argumentSteve Neasebefore adoptione38acdb
lines 56–57why, one step back56 #[error("File containing stdin data '{0}' does not exist")]57 StdinDataFileDoesNotExist(String),Rename to OptionsDavid Peterbefore adoptionb54b2f8
line 58why, one step back58}