1use std::num::ParseFloatError;
2
3use thiserror::Error;
4
5use fraction::error::ParseError as ParsingFractionError;
6use standardform::ParsingStandardFormError ;
7
8#[derive(Error,Debug,Clone)]
12#[error("Failed to parse the number:\nfraction error: {fraction},\ndouble error: {double},\nstandard form error: {sf}",)]
13pub struct ParsingNumberError {
14 fraction : ParsingFractionError,
15 double : ParseFloatError,
16 sf : ParsingStandardFormError
17}
18
19impl ParsingNumberError {
20 pub(crate) fn new(fraction : ParsingFractionError, double : ParseFloatError,sf : ParsingStandardFormError) -> Self {
21 Self { fraction , double , sf }
22 }
23
24 pub fn fraction(&self) -> &ParsingFractionError {
26 &self.fraction
27 }
28
29 pub fn double(&self) -> &ParseFloatError {
31 &self.double
32 }
33
34 pub fn standardform(&self) -> &ParsingStandardFormError {
36 &self.sf
37 }
38}