Include lookup contents when lookups fail#614
Merged
Conversation
This would have helped with #598 if we had known, from the exception, the actual lookup that had failed. The only way I could think of doing this was to move the failed lookup handling deeper into the stack, though I think I like the way this works better than before. Now, when a lookup fails, it'll look like this: ``` FailedVariableLookup: Couldn't resolve lookup in variable `MyVar`, lookup: ${output foo::bar}: 'NoneType' object has no attribute 'outputs' ```
phobologic
commented
Jul 1, 2018
|
|
||
| def test_autoloaded_lookup_handlers(self): | ||
| handlers = ["output", "xref"] | ||
| handlers = [ |
Member
Author
There was a problem hiding this comment.
I realized we weren't testing all the auto-loaded lookups, so I went ahead and added them.
ejholmes
approved these changes
Jul 3, 2018
ejholmes
left a comment
Contributor
There was a problem hiding this comment.
Got some merge conflicts, but otherwise, this is great 👍 .
phrohdoh
pushed a commit
to phrohdoh/stacker
that referenced
this pull request
Dec 18, 2018
* Include lookup contents when lookups fail This would have helped with cloudtools#598 if we had known, from the exception, the actual lookup that had failed. The only way I could think of doing this was to move the failed lookup handling deeper into the stack, though I think I like the way this works better than before. Now, when a lookup fails, it'll look like this: ``` FailedVariableLookup: Couldn't resolve lookup in variable `MyVar`, lookup: ${output foo::bar}: 'NoneType' object has no attribute 'outputs' ``` * Fix tests to patch LOOKUP_HANDLERS for outputs * Include wrapped exception type in output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This would have helped with #598 if we had known, from the exception, the
actual lookup that had failed. The only way I could think of doing this
was to move the failed lookup handling deeper into the stack, though I
think I like the way this works better than before.
Now, when a lookup fails, it'll look like this: