@@ -229,7 +229,6 @@ impl Handler for CratesfyiHandler {
229
229
self . static_handler . handle ( req) . or ( Err ( e) )
230
230
} )
231
231
. or_else ( |e| {
232
- debug ! ( "{}" , e. description( ) ) ;
233
232
let err = if let Some ( err) = e. error . downcast :: < error:: Nope > ( ) {
234
233
* err
235
234
} else if e. error . downcast :: < NoRoute > ( ) . is_some ( ) {
@@ -238,33 +237,31 @@ impl Handler for CratesfyiHandler {
238
237
panic ! ( "all cratesfyi errors should be of type Nope" ) ;
239
238
} ;
240
239
241
- match err {
242
- error:: Nope :: ResourceNotFound => {
243
- // print the path of the URL that triggered a 404 error
244
- struct DebugPath < ' a > ( & ' a iron:: Url ) ;
245
- impl < ' a > fmt:: Display for DebugPath < ' a > {
246
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
247
- for path_elem in self . 0 . path ( ) {
248
- write ! ( f, "/{}" , path_elem) ?;
249
- }
250
-
251
- if let Some ( query) = self . 0 . query ( ) {
252
- write ! ( f, "?{}" , query) ?;
253
- }
254
-
255
- if let Some ( hash) = self . 0 . fragment ( ) {
256
- write ! ( f, "#{}" , hash) ?;
257
- }
258
-
259
- Ok ( ( ) )
240
+ if let error:: Nope :: ResourceNotFound = err {
241
+ // print the path of the URL that triggered a 404 error
242
+ struct DebugPath < ' a > ( & ' a iron:: Url ) ;
243
+ impl < ' a > fmt:: Display for DebugPath < ' a > {
244
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
245
+ for path_elem in self . 0 . path ( ) {
246
+ write ! ( f, "/{}" , path_elem) ?;
247
+ }
248
+
249
+ if let Some ( query) = self . 0 . query ( ) {
250
+ write ! ( f, "?{}" , query) ?;
251
+ }
252
+
253
+ if let Some ( hash) = self . 0 . fragment ( ) {
254
+ write ! ( f, "#{}" , hash) ?;
260
255
}
261
- }
262
256
263
- debug ! ( "Path: {}" , DebugPath ( & req. url) ) ;
257
+ Ok ( ( ) )
258
+ }
264
259
}
265
- _ => { }
260
+
261
+ debug ! ( "Path not found: {}" , DebugPath ( & req. url) ) ;
266
262
}
267
263
264
+
268
265
Self :: chain ( err) . handle ( req)
269
266
} )
270
267
}
0 commit comments