Skip to content

Commit 99e2109

Browse files
committed
Add error type to logs
1 parent c0ad038 commit 99e2109

File tree

1 file changed

+8
-1
lines changed
  • core/codegen/src/attribute/route

1 file changed

+8
-1
lines changed

core/codegen/src/attribute/route/mod.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ fn query_decls(route: &Route) -> Option<TokenStream> {
113113
"{_err}"
114114
); } }
115115
);
116+
::rocket::trace::info!(
117+
target: concat!("rocket::codegen::route::", module_path!()),
118+
error_type = ::std::any::type_name_of_val(&__error),
119+
"Forwarding error"
120+
);
116121

117122
return #Outcome::Forward((#__data, #Status::UnprocessableEntity, #resolve_error!(__e)));
118123
}
@@ -151,6 +156,7 @@ fn request_guard_decl(guard: &Guard) -> TokenStream {
151156
parameter = stringify!(#ident),
152157
type_name = stringify!(#ty),
153158
reason = %#display_hack!(&__e),
159+
error_type = ::std::any::type_name_of_val(&__e),
154160
"request guard failed"
155161
);
156162

@@ -174,8 +180,8 @@ fn param_guard_decl(guard: &Guard) -> TokenStream {
174180
target: concat!("rocket::codegen::route::", module_path!()),
175181
parameter = #name,
176182
type_name = stringify!(#ty),
177-
error_ty = std::any::type_name_of_val(&__error),
178183
reason = %#display_hack!(&__error),
184+
error_type = ::std::any::type_name_of_val(&__error),
179185
"path guard forwarding"
180186
);
181187

@@ -245,6 +251,7 @@ fn data_guard_decl(guard: &Guard) -> TokenStream {
245251
parameter = stringify!(#ident),
246252
type_name = stringify!(#ty),
247253
reason = %#display_hack!(&__e),
254+
error_type = ::std::any::type_name_of_val(&__error),
248255
"data guard failed"
249256
);
250257

0 commit comments

Comments
 (0)