Skip to content

Commit

Permalink
Add: add 401 code case in response
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkjin99 committed Nov 5, 2023
1 parent 0795001 commit ac2a7a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ def handler(event: dict, context: dict) -> dict:
student_id = body["student_id"]
password = body["password"]
res = asyncio.run(update_cache(student_id, password)) # 예약 현황 조회
put_cache_s3(res)
# put_cache_s3(res)
response = create_response(200, json.dumps({"data": res}))

except AssertionError as e:
response = create_response(401, json.dumps({"data": str(e)}))

except Exception as e:
response = create_response(500, json.dumps({"data": str(e)}))

Expand Down

0 comments on commit ac2a7a9

Please sign in to comment.