@@ -415,13 +415,14 @@ async fn process_sql_request(
415415 . sql_file_cache
416416 . get ( app_state, & sql_path)
417417 . await
418+ . with_context ( || format ! ( "Unable to get SQL file {:?}" , sql_path) )
418419 . map_err ( anyhow_err_to_actix) ?;
419420 let response = render_sql ( & mut req, sql_file) . await ?;
420421 Ok ( req. into_response ( response) )
421422}
422423
423424fn anyhow_err_to_actix ( e : anyhow:: Error ) -> actix_web:: Error {
424- log:: error!( "Error while trying to get SQL file: { :#}" , e ) ;
425+ log:: error!( "{e :#}" ) ;
425426 match e. downcast :: < ErrorWithStatus > ( ) {
426427 Ok ( err) => actix_web:: Error :: from ( err) ,
427428 Err ( e) => ErrorInternalServerError ( format ! (
@@ -442,6 +443,7 @@ async fn serve_file(
442443 . file_system
443444 . modified_since ( state, path. as_ref ( ) , since, false )
444445 . await
446+ . with_context ( || format ! ( "Unable to get modification time of file {:?}" , path) )
445447 . map_err ( anyhow_err_to_actix) ?;
446448 if !modified {
447449 return Ok ( HttpResponse :: NotModified ( ) . finish ( ) ) ;
@@ -451,6 +453,7 @@ async fn serve_file(
451453 . file_system
452454 . read_file ( state, path. as_ref ( ) , false )
453455 . await
456+ . with_context ( || format ! ( "Unable to read file {:?}" , path) )
454457 . map_err ( anyhow_err_to_actix)
455458 . map ( |b| {
456459 HttpResponse :: Ok ( )
0 commit comments