@@ -66,7 +66,10 @@ impl Router {
66
66
match selected_routes. len ( ) {
67
67
0 => Ok ( None ) ,
68
68
1 => Ok ( Some ( selected_routes. first ( ) . unwrap ( ) ) ) ,
69
- _ => bail ! ( "multiple selected routes is not possible" ) ,
69
+ _ => bail ! (
70
+ "multiple selected routes even though that should not happen: {:?}" ,
71
+ selected_routes
72
+ ) ,
70
73
}
71
74
}
72
75
@@ -82,8 +85,11 @@ impl Router {
82
85
return callback ( request, & routing_data) ;
83
86
}
84
87
88
+ trace ! ( "no matching server route, trying other options..." ) ;
89
+
85
90
// test against file server static mappings
86
91
if let Some ( file_server) = & self . file_server {
92
+ trace ! ( "attempting with file server" ) ;
87
93
match file_server. handle_file_access ( & route. path ) {
88
94
Ok ( file_path) => {
89
95
let mime_type = mime_guess:: from_path ( & file_path) . first_or_octet_stream ( ) ;
@@ -94,15 +100,17 @@ impl Router {
94
100
. set_content_type ( mime_type. as_ref ( ) )
95
101
. build ( ) ;
96
102
}
97
- Err ( e) => warn ! ( "failed to match file: {e}" ) ,
103
+ Err ( e) => trace ! ( "no match with file server : {e}" ) ,
98
104
}
99
105
}
100
106
101
107
// test against catcher routes
102
108
if let Some ( catcher) = self . catcher_routes . get ( & request. method ) {
109
+ trace ! ( "defaulting to catcher for {}" , request. method. to_string( ) ) ;
103
110
return catcher ( request, & RoutingData :: default ( ) ) ;
104
111
}
105
112
113
+ trace ! ( "no default catcher, return 404" ) ;
106
114
HttpResponseBuilder :: new ( )
107
115
. set_status ( HttpStatusCode :: NotFound )
108
116
. build ( )
0 commit comments