Skip to content
Myr

error.rs

This file

Path

src/error.rs

62 lines · 2.5 KiB · Rust

Last changed by

Handle broken pipe errors on stdout gracefully (#932)jkbefore adoptionc0b3834

History of this file

Take it

The walk stopped after 200 commits: lines older than 6bbb837 point at it.

Bump assert_cmd from 2.0.7 to 2.0.8dependabot[bot]before adoption6bbb837

lines 1–6why, one step back
1use std::num::{self, ParseFloatError, ParseIntError};
23use rust_decimal::Error as DecimalError;4use thiserror::Error;56#[derive(Debug, Error)]

Handle broken pipe errors on stdout gracefully (#932)jkbefore adoptionc0b3834

lines 7–10why, one step back
7#[error(transparent)]
8pub struct ConsoleOutputError(pub std::io::Error);910#[derive(Debug, Error)]

Bump assert_cmd from 2.0.7 to 2.0.8dependabot[bot]before adoption6bbb837

lines 11–59why, one step back
11pub enum ParameterScanError {
12 #[error("Error while parsing parameter scan arguments ({0})")]13 ParseIntError(num::ParseIntError),14 #[error("Error while parsing parameter scan arguments ({0})")]15 ParseDecimalError(DecimalError),16 #[error("Empty parameter range")]17 EmptyRange,18 #[error("Parameter range is too large")]19 TooLarge,20 #[error("Zero is not a valid parameter step")]21 ZeroStep,22 #[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")]23 StepRequired,24 #[error("'--command-name' has been specified {0} times. It has to appear exactly once, or exactly {1} times (number of benchmarks)")]25 UnexpectedCommandNameCount(usize, usize),26}2728impl From<num::ParseIntError> for ParameterScanError {29 fn from(e: num::ParseIntError) -> ParameterScanError {30 ParameterScanError::ParseIntError(e)31 }32}3334impl From<DecimalError> for ParameterScanError {35 fn from(e: DecimalError) -> ParameterScanError {36 ParameterScanError::ParseDecimalError(e)37 }38}3940#[derive(Debug, Error)]41pub enum OptionsError<'a> {42 #[error(43 "Conflicting requirements for the number of runs (empty range, min is larger than max)"44 )]45 EmptyRunsRange,46 #[error("Too many --command-name options: Expected {0} at most")]47 TooManyCommandNames(usize),48 #[error("'--command-name' has been specified {0} times. It has to appear exactly once, or exactly {1} times (number of benchmarks)")]49 UnexpectedCommandNameCount(usize, usize),50 #[error("Could not read numeric integer argument to '--{0}': {1}")]51 IntParsingError(&'a str, ParseIntError),52 #[error("Could not read numeric floating point argument to '--{0}': {1}")]53 FloatParsingError(&'a str, ParseFloatError),54 #[error("An empty command has been specified for the '--shell <command>' option")]55 EmptyShell,56 #[error("Failed to parse '--shell <command>' expression as command line: {0}")]57 ShellParseError(shell_words::ParseError),58 #[error("Unknown output policy '{0}'. Use './{0}' to output to a file named '{0}'.")]59 UnknownOutputPolicy(String),

Change error messageDavid Peterbefore adoptione4790ab

line 60why, one step back
60 #[error("The file '{0}' specified as '--input' does not exist")]

Added --stdin-data argumentSteve Neasebefore adoptione38acdb

line 61why, one step back
61 StdinDataFileDoesNotExist(String),

Bump assert_cmd from 2.0.7 to 2.0.8dependabot[bot]before adoption6bbb837

line 62why, one step back
62}