From 37734fbc77d1fc010f62e9890ec74a6d4d72ed33 Mon Sep 17 00:00:00 2001 From: EndoNrak Date: Sun, 8 Oct 2023 08:26:46 +0900 Subject: [PATCH] update error message output --- .../post_turtle_training_code/post_turtle_training_code.py | 6 +++--- cloud/sam/template.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cloud/sam/scripts/post_turtle_training_code/post_turtle_training_code.py b/cloud/sam/scripts/post_turtle_training_code/post_turtle_training_code.py index d547c7a..cc72710 100644 --- a/cloud/sam/scripts/post_turtle_training_code/post_turtle_training_code.py +++ b/cloud/sam/scripts/post_turtle_training_code/post_turtle_training_code.py @@ -6,7 +6,7 @@ FRONTEND_ORIGIN = os.environ["FRONTEND_ORIGIN"] LAMBDA_TASK_ROOT = os.environ["LAMBDA_TASK_ROOT"] -SUBPROCESS_TIMEOUT_LIMIT = 30 +SUBPROCESS_TIMEOUT_LIMIT = 60 def lambda_handler(event: dict, context): @@ -45,10 +45,10 @@ def evaluation(event: dict, context): "Content-Type": "text/plain", }, } - except subprocess.CalledProcessError: + except subprocess.CalledProcessError as e: response = { "statusCode": 400, - "body": "Runtime error", + "body": f"Runtime error\n{e.stderr.decode('utf-8')}", "headers": { "Content-Type": "text/plain", }, diff --git a/cloud/sam/template.yaml b/cloud/sam/template.yaml index 4202c97..f97080e 100644 --- a/cloud/sam/template.yaml +++ b/cloud/sam/template.yaml @@ -253,7 +253,7 @@ Resources: DockerTag: latest Properties: PackageType: Image - Timeout: 10 + Timeout: 60 Events: PostTetrisTrainingCodeEndpoint: Type: Api