aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Hoeppner2014-11-26 22:45:07 +0100
committerTill Hoeppner2014-11-26 22:45:07 +0100
commitae2651ee86f604757b5474dee8b343d28f0fce75 (patch)
treeadf75c7c31af758a11ffb7fe0e71996f80b596d1
parent15fa7769ecb645eaa6629ff068e8a3e91e3b9942 (diff)
downloadsersve-ae2651ee86f604757b5474dee8b343d28f0fce75.tar.gz
sersve-ae2651ee86f604757b5474dee8b343d28f0fce75.tar.xz
sersve-ae2651ee86f604757b5474dee8b343d28f0fce75.zip
Mildly better errors
-rw-r--r--src/sersve.rs10
1 files 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<Response> {
let root = {
let o = req.get::<Read<OptCarrier, Mutex<Options>>>().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::<OptCarrier, Mutex<Options>>::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)
}
}