diff options
author | metamuffin <metamuffin@disroot.org> | 2023-02-26 16:18:45 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-02-26 16:18:45 +0100 |
commit | a3fb25019336ab9238d73f29a004b71cfc31a032 (patch) | |
tree | 783b91075f61f4b89eef35f08064ca15b0ddb2f9 /src/error.rs | |
parent | c3371bd7e3eb40fad374fe85a994806c2d27488e (diff) | |
download | gnix-a3fb25019336ab9238d73f29a004b71cfc31a032.tar gnix-a3fb25019336ab9238d73f29a004b71cfc31a032.tar.bz2 gnix-a3fb25019336ab9238d73f29a004b71cfc31a032.tar.zst |
support range requests
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index cbeb6a6..9a83aff 100644 --- a/src/error.rs +++ b/src/error.rs @@ -10,6 +10,10 @@ pub enum ServiceError { NotFound, #[error("io error: {0}")] Io(std::io::Error), + #[error("bad range")] + BadRange, + #[error("bad utf8")] + BadUtf8, #[error("ohh. i didn't expect that this error can be generated.")] Other, } @@ -19,3 +23,8 @@ impl From<std::io::Error> for ServiceError { Self::Io(e) } } +impl From<std::str::Utf8Error> for ServiceError { + fn from(_: std::str::Utf8Error) -> Self { + Self::BadUtf8 + } +} |