From c223bf81facadb39e8f1d89d8c561dcc3a58832b Mon Sep 17 00:00:00 2001 From: Stephen Hoover Date: Wed, 21 Sep 2016 21:01:21 -0500 Subject: [PATCH] ENH Preserve session data when reporting an unhandled error Give users a chance to recover by leaving the session open and persisting the input session data. --- lambda_function.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lambda_function.py b/lambda_function.py index cae6fab..0bfc615 100644 --- a/lambda_function.py +++ b/lambda_function.py @@ -34,4 +34,6 @@ def lambda_handler(event, context): is_end=False) except Exception as err: # NOQA log.exception('Unhandled exception for event\n%s\n' % str(event)) - return reply.build("Sorry, something went wrong. Please try again.") + return reply.build("Sorry, something went wrong. Please try again.", + persist=event['session'].get('attributes', {}), + is_end=False)