Skip to content
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

Sceptre is silencing 3rd party exceptions #507

Closed
1oglop1 opened this issue Nov 20, 2018 · 1 comment
Closed

Sceptre is silencing 3rd party exceptions #507

1oglop1 opened this issue Nov 20, 2018 · 1 comment

Comments

@1oglop1
Copy link
Contributor

1oglop1 commented Nov 20, 2018

I have had a Jinja error inside my stack_config.yaml and sceptre just printed the message from the exception without notifying it's an error or any other problem so the result looked like correct program exit.

example:

env/stack.yaml

{% set %}
template_path: path/to/template.py

sceptre launch-stack env stack

Actual result:

Expected an expression, got 'end of statement block'

Expected result:
Jinja2 exception trace back which also contains very important information where the error is:

  File "env/stack.yaml", line 1, in template
    {% set  %}

... here the traceback continues ...
#and the last line is
jinja2.exceptions.TemplateSyntaxError: Expected an expression, got 'end of statement block'

It would be nice to either throw entire exception or give user refined information such as: path/stack.yaml, line number, error

Additional info:

I got lucky and caught entire exception during hook development for sceptre v1, but I cannot replicate it for v2 as the concept of environments is gone.
I used this code to run the hook inside interpreter.

if __name__ == '__main__':
    from sceptre.environment import Environment
    # change current directory
    import os

    # os.chdir('..')
    SCEPTRE_DIR = os.path.join(os.getcwd())
    env = Environment(SCEPTRE_DIR, "env")
    # print(env)
    stack = env.stacks["stack"]
    # print(stack)
    hook = EsCognitoOptions(environment_config=stack.environment_config,
                            stack_config=stack.config, connection_manager=stack.connection_manager)
    hook.run() 
@craighurley
Copy link
Contributor

craighurley commented Oct 18, 2021

This should be fixed now that #997 was merged. Closing. Re-open if there are still issues after including --debug in your command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants