diff options
-rw-r--r-- | src/error/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/error/mod.rs b/src/error/mod.rs index 649ef08..9ac6816 100644 --- a/src/error/mod.rs +++ b/src/error/mod.rs | |||
@@ -13,6 +13,7 @@ pub enum CalcError { | |||
13 | pub enum Math { | 13 | pub enum Math { |
14 | DivideByZero, | 14 | DivideByZero, |
15 | OutOfBounds, | 15 | OutOfBounds, |
16 | UnknownBase | ||
16 | } | 17 | } |
17 | 18 | ||
18 | pub fn handler(e: CalcError) -> String { | 19 | pub fn handler(e: CalcError) -> String { |
@@ -20,7 +21,8 @@ pub fn handler(e: CalcError) -> String { | |||
20 | CalcError::Math(math_err) => { | 21 | CalcError::Math(math_err) => { |
21 | match math_err { | 22 | match math_err { |
22 | Math::DivideByZero => format!("Math Error: Divide by zero error!"), | 23 | Math::DivideByZero => format!("Math Error: Divide by zero error!"), |
23 | Math::OutOfBounds => format!("Domain Error: Out of bounds!") | 24 | Math::OutOfBounds => format!("Domain Error: Out of bounds!"), |
25 | Math::UnknownBase => format!("Base too large! Accepted ranges: 0 - 36") | ||
24 | } | 26 | } |
25 | }, | 27 | }, |
26 | CalcError::Syntax(details) => { | 28 | CalcError::Syntax(details) => { |