From ab661988da7b42aa4fca5d1375f04cdf170c1ea4 Mon Sep 17 00:00:00 2001 From: Alex Harvey Date: Wed, 7 Apr 2021 01:19:50 +1000 Subject: [PATCH] Stop hiding critical debug info in helpers (#988) Before this, the catch_exceptions function in cli/helpers would catch a range of exceptions and then hide all but the error message from the caller. Over the years, this has caused myself and others quite a lot of lost time, as it is now often quite unclear what caused Sceptre to fail. Simply re-raising the original exception provides valuable information to allow users of Sceptre to debug their failing code. --- sceptre/cli/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sceptre/cli/helpers.py b/sceptre/cli/helpers.py index 69edba63f..c088491e9 100644 --- a/sceptre/cli/helpers.py +++ b/sceptre/cli/helpers.py @@ -30,14 +30,14 @@ def catch_exceptions(func): def decorated(*args, **kwargs): """ Invokes ``func``, catches expected errors, prints the error message and - exits sceptre with a non-zero exit code. + re-raises. """ try: return func(*args, **kwargs) except (SceptreException, BotoCoreError, ClientError, Boto3Error, TemplateError) as error: write(error) - sys.exit(1) + raise return decorated