From ae2651ee86f604757b5474dee8b343d28f0fce75 Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Wed, 26 Nov 2014 22:45:07 +0100 Subject: Mildly better errors --- src/sersve.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/sersve.rs b/src/sersve.rs index eadb0f0..1d6e91c 100644 --- a/src/sersve.rs +++ b/src/sersve.rs @@ -14,8 +14,6 @@ use std::io::fs::{ File, PathExtensions }; use std::default::Default; use std::sync::Mutex; -use error::Error; - use getopts::{ optopt, optflag, getopts, usage, OptGroup }; use serialize::json; @@ -143,7 +141,7 @@ fn serve(req: &mut Request) -> IronResult { let root = { let o = req.get::>>().unwrap(); let mutex = o.lock(); - mutex.root.clone().unwrap() //_or_else(|| os::getcwd().ok().unwrap()) + mutex.root.clone().unwrap_or_else(|| os::getcwd().ok().unwrap()) }; let mut path = root.clone(); @@ -234,10 +232,6 @@ fn main() { chain.link(Read::>::both(options)); match Iron::new(chain).listen((host[], port)) { Ok(_) => (), - Err(e) => println!("I'm sorry, I failed you. {}", if e.description().is_some() { - e.description().unwrap()[] - } else { - "And I don't even know why..." - }) + Err(e) => println!("I'm sorry, I failed you. {}", e) } } -- cgit v1.2.3