New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CFn: optional verbose errors #8336
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @simonrw! It's great to see instrumentation improving in LocalStack and giving us more dials to turn when debugging.
I'm trying to understand whether this flag is targeted at users to allow them to look into why their stack isn't deploying, or whether this is targeted as a debugging tool for LocalStack (much like DEBUG=1
. In which case my follow up question would be whether this is generalizable under a DEBUG_CFN
flag that enables a debug mode for cloudformation (we have this pattern in other areas as well, DEBUG_HANDLER_CHAIN
, DEBUG_ANALYTICS
, DEBUG_LICENSING
, etc).
If there is a particular reason to toggle only exception reporting, it seems we may consider doing things differently all together and raise exceptions rather than catching and logging them?
I would see this as mostly helpful for us - if a user receives a verbose error or exception, they are not immediately going to know how to resolve their problem, or even if it's a problem on their end.
I'm happy to include this plus potentially more introspection tools under a common flag.
Only that it is the minimal set of changes. We will likely revisit this concept when we get further into our refactoring. In addition, the current implementation is very trial and error, and it doesn't make sense to raise every exception since some are sort of expected (not ideal IMO). |
merging this for now, since i actually needed it the other day :P |
There is currently lots of exception handling in and around the template deployer within CloudFormation. This makes it more complex to understand what goes wrong with stack deployments.
This change adds a config variable to present exceptions either:
exception
level the message, exception and traceback, instead of logging at a lower level (often debug) with a possibly less-than-helpful error message.This feature can be enabled with the
CFN_VERBOSE_ERRORS
configuration variable/environment variable.