File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/webserver/database/sqlpage_functions Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,19 @@ pub(super) async fn upload_to_s3<'a>(
2727 if !full_path. starts_with ( web_root) {
2828 anyhow:: bail!( "Security violation: Access denied to file outside web root" ) ;
2929 }
30- tokio:: fs:: read ( & full_path) . await . with_context ( || format ! ( "Unable to read file {}" , full_path. display( ) ) ) ?
30+ tokio:: fs:: read ( & full_path) . await . map_err ( |e| {
31+ log:: error!( "Failed to read file {}: {}" , full_path. display( ) , e) ;
32+ e
33+ } ) . with_context ( || format ! ( "Unable to read file {}" , full_path. display( ) ) ) ?
3134 } else {
3235 // Assume base64
3336 use base64:: Engine ;
3437 base64:: engine:: general_purpose:: STANDARD
3538 . decode ( data. as_bytes ( ) )
39+ . map_err ( |e| {
40+ log:: error!( "Base64 decode failed: {}" , e) ;
41+ e
42+ } )
3643 . context ( "Invalid base64 data" ) ?
3744 } ;
3845
You can’t perform that action at this time.
0 commit comments