summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs
index 7dc0567..163a20e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -32,6 +32,7 @@ pub enum Error {
InternalStr(String),
UserError(hyper::Response<hyper::Body>),
RoutingError(trout::RoutingFailure),
+ RemoteError((hyper::StatusCode, String)),
}
impl<T: 'static + std::error::Error + Send> From<T> for Error {
@@ -86,7 +87,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(val) => val,
Err(Error::UserError(res)) => res,
Err(Error::RoutingError(err)) => err.to_simple_response(),
- Err(Error::Internal(err)) => {
+ Err(err) => {
eprintln!("Error: {:?}", err);
simple_response(
@@ -94,14 +95,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
"Internal Server Error",
)
}
- Err(Error::InternalStr(err)) => {
- eprintln!("Error: {}", err);
-
- simple_response(
- hyper::StatusCode::INTERNAL_SERVER_ERROR,
- "Internal Server Error",
- )
- }
})
}
}))