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

Ability to run some user code whenever a binding throws an exception #5006

Open
jeffhollan opened this issue Oct 2, 2019 · 6 comments
Open

Comments

@jeffhollan
Copy link

Realize we may do much more than what's scoped in title (trigger for any unhandled exception) but the scenario we have committed to resolve by end of this calendar year is:

A customer wants to use an output binding (and not using with Flush). If the output binding hits an exception, I need some way to get the context of the execution and the context of the exception to handle it.

We know richer bindings could allow something like FlushAsync for non-.NET languages (and for mitigation for now .NET users can use an ICollectorAsync with FlushAsync to catch exceptions there), but need something shorter term.

Have vetted with a few customers and the idea of having an "Exception trigger" for an "Exception function" works fine. As long as the trigger has the right context of the execution that hit an exception, and exception details, so it can be handled correctly.

@jeffhollan jeffhollan added this to the Triaged milestone Oct 2, 2019
@espray
Copy link

espray commented Oct 2, 2019

@jeffhollan wound I beable to modify the http response in this Exception Trigger?

@jeffhollan
Copy link
Author

Good question. My expectation would almost be the trigger would execute async to the function that hit the exception - meaning that the HTTP response for an HTTP trigger would likely not be able to be changed - but I don't know what's possible. I suspect not - at least with my current thinking of how this would - and best bet for what you are looking for would be using richer bindings (currently only possible in .NET) where you can catch in code, or using SDK directly and not using output bindings

@jeffhollan
Copy link
Author

But would let @fabiocav and @mathewc chime in who are starting to chew on how this feature could work

@tomkerkhove
Copy link
Member

tomkerkhove commented Oct 3, 2019

Love the idea!

@mathewc
Copy link
Member

mathewc commented Oct 3, 2019

This issue is a duplicate of several other issues we're already tracking:

In particular, the Invocation Filters feature allows for method/class level error handlers to be specified. That's already there for .NET languages - the work item above is about enabling it for other languages. Also related - we have an ErrorTrigger in the Extensions SDK that wasn't migrated forward to Functions v2.

@Schuer84
Copy link

@mathewc Any updates on this one? Got a custom binding used in combination with a HttpTrigger.. but no proper way to handle exceptions and thus the eventual response.

@fabiocav fabiocav removed this from the Triaged milestone Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants