aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/error.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index 12fcaf2..78508ae 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1 +1,19 @@
-pub enum Error {}
+use std::str::Utf8Error;
+
+pub enum Error {
+ ReadError(std::io::Error),
+ Utf8Error(Utf8Error),
+ ParseError(String),
+}
+
+impl From<std::io::Error> for Error {
+ fn from(e: std::io::Error) -> Self {
+ Self::ReadError(e)
+ }
+}
+
+impl From<Utf8Error> for Error {
+ fn from(e: Utf8Error) -> Self {
+ Self::Utf8Error(e)
+ }
+}