Skip to content

Commit

Permalink
Merge branch 'main' into 'main'
Browse files Browse the repository at this point in the history
Improve error message

See merge request codbase/decimal-rs!11
  • Loading branch information
davidli2010 committed Jun 3, 2021
2 parents 4756380 + 220e3da commit 97cf5da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ use thiserror::Error;
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum DecimalParseError {
/// Empty string.
#[error("cannot parse decimal from empty string")]
#[error("cannot parse number from empty string")]
Empty,
/// Invalid decimal.
#[error("invalid decimal literal")]
#[error("invalid number")]
Invalid,
/// Decimal is overflowed.
#[error("value overflows decimal format")]
#[error("numeric overflow")]
Overflow,
}

/// An error which can be returned when a conversion between other type and decimal fails.
#[derive(Clone, Debug, Eq, PartialEq, Error)]
pub enum DecimalConvertError {
/// Invalid decimal.
#[error("cannot convert to decimal")]
#[error("invalid number")]
Invalid,
/// Decimal is overflowed.
#[error("value is out of range")]
#[error("numeric overflow")]
Overflow,
}

Expand Down

0 comments on commit 97cf5da

Please sign in to comment.