File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -10,5 +10,7 @@ RUN dnf install -y time tar
10
10
11
11
COPY target/lambda/online-judge-rust/bootstrap ${LAMBDA_RUNTIME_DIR}/bootstrap
12
12
13
+ ENV RUST_BACKTRACE=1
14
+
13
15
# This is passed in as argv[1] to /var/runtime/bootstrap. The value shouldn't matter.
14
16
CMD [ "_handler" ]
Original file line number Diff line number Diff line change 2
2
//! Taken from https://github.com/tokio-rs/axum/blob/main/examples/anyhow-error-response/src/main.rs
3
3
4
4
use axum:: { http:: StatusCode , response:: { IntoResponse , Response } } ;
5
+ use lambda_http:: tracing:: error;
5
6
6
7
// Make our own error that wraps `anyhow::Error`.
7
8
pub struct AppError ( anyhow:: Error ) ;
8
9
9
10
// Tell axum how to convert `AppError` into a response.
10
11
impl IntoResponse for AppError {
11
12
fn into_response ( self ) -> Response {
12
- println ! ( "Returning Internal Server Error: {}" , self . 0 ) ;
13
+ error ! ( "Returning Internal Server Error: {:? }" , self . 0 ) ;
13
14
(
14
15
StatusCode :: INTERNAL_SERVER_ERROR ,
15
- format ! ( "Internal Server Error: {}" , self . 0 ) ,
16
+ format ! ( "Internal Server Error: {:? }" , self . 0 ) ,
16
17
)
17
18
. into_response ( )
18
19
}
You can’t perform that action at this time.
0 commit comments