summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2022-01-22 08:45:24 -0500
committerAdam T. Carpenter <atc@53hor.net>2022-01-22 15:18:04 -0500
commitba49aa806a48839b61fb261f7ccd007a507d8d50 (patch)
tree222855376c301972a10bb8656c94731fc40ded76 /src/error.rs
parentd7472320a00fa0bfd6b9be904e0730461f093f61 (diff)
downloadtwinh-ba49aa806a48839b61fb261f7ccd007a507d8d50.tar.xz
twinh-ba49aa806a48839b61fb261f7ccd007a507d8d50.zip
feat: experimental cgi forkcgi
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/error.rs b/src/error.rs
deleted file mode 100644
index f987d66..0000000
--- a/src/error.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-use bincode::Error as bincode_e;
-use hyper::Error as hyper_e;
-use sled::Error as sled_e;
-use std::fmt;
-use std::net::AddrParseError;
-use std::num::ParseIntError;
-
-#[derive(Debug)]
-pub struct TwinHError(pub String);
-
-impl TwinHError {
- fn bail(self) {}
-}
-
-impl std::error::Error for TwinHError {}
-
-impl std::fmt::Display for TwinHError {
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
- write!(f, "twinh: {}", self.0)
- }
-}
-
-impl From<sled_e> for TwinHError {
- fn from(e: sled_e) -> Self {
- Self(format!("database error: {}", e))
- }
-}
-
-impl From<bincode_e> for TwinHError {
- fn from(e: bincode_e) -> Self {
- Self(format!("(de)serialization error: {}", e))
- }
-}
-
-impl From<AddrParseError> for TwinHError {
- fn from(e: AddrParseError) -> Self {
- Self(format!("failed to parse addr: {}", e))
- }
-}
-
-impl From<ParseIntError> for TwinHError {
- fn from(e: ParseIntError) -> Self {
- Self(format!("failed to parse port: {}", e))
- }
-}
-
-impl From<hyper_e> for TwinHError {
- fn from(e: hyper_e) -> Self {
- Self(format!("server error: {}", e))
- }
-}