We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cb0bc2 commit 4abb1b1Copy full SHA for 4abb1b1
src/conduit-router.rs
@@ -94,7 +94,10 @@ impl conduit::Handler for RouteBuilder {
94
let method = request.method();
95
let path = request.path();
96
97
- self.recognize(&method, path).unwrap()
+ match self.recognize(&method, path) {
98
+ Ok(m) => m,
99
+ Err(e) => return Err(box e as Box<Show>)
100
+ }
101
};
102
103
{
@@ -191,6 +194,9 @@ mod tests {
191
194
192
195
assert_eq!(res.status, (200, "OK"));
193
196
assert_eq!(res.body.read_to_str().unwrap(), "10, Post".to_str());
197
+
198
+ let mut req = RequestSentinel::new(conduit::Post, "/nonexistent");
199
+ router.call(&mut req).err().expect("No response");
200
}
201
202
fn handler1(req: &mut conduit::Request) -> Result<conduit::Response, ()> {
0 commit comments