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

Use try-finally to ensure filter_output is unregistered #278

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ReaNAiveD
Copy link

@ReaNAiveD ReaNAiveD commented Aug 25, 2023

Related Issue
Azure/azure-cli#27228

Description
If query_expression.search raises an Exception, the following line cli_ctx.unregister_event(EVENT_INVOKER_FILTER_RESULT, filter_output) won't be executed, and the callback with error remains in the _event_handlers.
image
Az Interactive uses the same cli_ctx for every command execution, so if there is an exception related to --query, it will keep happening for any subsequent commands.
image

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

Successfully merging this pull request may close these issues.

1 participant