- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda_function.py
More file actions
Latest commit
24 lines (21 loc) · 894 Bytes
/
Copy pathlambda_function.py
File metadata and controls
24 lines (21 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# lambda_function.py
importjson
importmiddleware
importsettings
deflambda_handler(event, context=None):
"""
As all exceptions are delegated to the top layer, this function will handle them
albiet, crudely for now with more information leak for testing purposes
"""
response= {}
try:
response=middleware.IdentityAuthMiddleWare.process_request(event, response)
exceptExceptionase:
response["message"] =e.message
response["errors"] =e.errors
# removing request_dump data
if"request_dump"inresponse["errors"]:
delresponse["errors"]["request_dump"]
for_k, _vinresponse["errors"].items():
response["errors"][_k] =str(_v)
returnresponse