Skip to content

Commit

Permalink
sls sdk captured error support
Browse files Browse the repository at this point in the history
  • Loading branch information
dschep committed Dec 26, 2019
1 parent 626734f commit db723ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lambda_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def handler(event, context):

logger = logging.getLogger(__name__)

__version__ = "0.3.0"
__version__ = "0.3.1"


class LambdaDecorator(object):
Expand Down Expand Up @@ -473,6 +473,8 @@ def wrapper(event, context):
try:
return {"statusCode": 200, "body": json.dumps(handler(event, context))}
except Exception as exception:
if hasattr(context, "serverless_sdk"):
context.serverless_sdk.capture_exception(exception)
return {"statusCode": 500, "body": str(exception)}

return wrapper
Expand Down

0 comments on commit db723ff

Please sign in to comment.