Skip to content

Commit

Permalink
Stop hiding critical debug info in helpers (Sceptre#988)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alex-harvey-z3q committed Apr 6, 2021
1 parent 881c6bd commit ab66198
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sceptre/cli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ab66198

Please sign in to comment.