summaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs
new file mode 100644
index 0000000..5713aa0
--- /dev/null
+++ b/src/errors.rs
@@ -0,0 +1,23 @@
+use std::error::Error;
+use std::fmt;
+
+#[derive(Debug)]
+pub struct ParseRangeError {
+ source_str: String,
+}
+
+impl ParseRangeError {
+ pub fn new(source_str: &str) -> Self {
+ ParseRangeError {
+ source_str: String::from(source_str),
+ }
+ }
+}
+
+impl fmt::Display for ParseRangeError {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "{}", self.source_str)
+ }
+}
+
+impl Error for ParseRangeError {}