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

Add hook for exception handling #1531

Open
tanyunshi opened this issue Jul 12, 2024 · 6 comments
Open

Add hook for exception handling #1531

tanyunshi opened this issue Jul 12, 2024 · 6 comments

Comments

@tanyunshi
Copy link

Binding Type

No response

Expected Behavior

I am looking for a place to centralize the exception handling. For example, to log all exceptions with the invocation id and a correlation ID.

As I cannot use a base class in azure functions (as they are functions :) ), I suppose that I can use the extensions, where I can implement behaviors for an event.

I wished I could use post_invocation_app_level but then I realize that this method will not be called if the function fails

It would be useful to have a method like "exception_invocation_app_level" for the application level extensions. The method is called once an exception is raised in the function execution. The function context, invocation args and the raised exception are passed to the methode.

Relevant sample code snipped

No response

Additional Information

No response

@bhagyshricompany
Copy link

thanks for reporting will discuss and update you.Thanks

@rokcarl
Copy link

rokcarl commented Jul 19, 2024

I have a similar requirement. In my case, I will be implementing Sentry, so I want a way to be able to handle all the exceptions. All my attempts have failed. Is there an existing way of hooking into this? I've also used Sentry's serverless decorator, but even though it's wrapping a function that gets called, the wrapped function just doesn't throw an error as it's apparently caught by Azure.

@bhagyshricompany
Copy link

@gavin-aguiar please confirm.Thanks

@gavin-aguiar
Copy link
Contributor

Hi all, we are working on a feature to provide this functionality. We don't have an ETA as of now but will keep this issue updated once the feature is released.

@tanyunshi
Copy link
Author

Hi all, we are working on a feature to provide this functionality. We don't have an ETA as of now but will keep this issue updated once the feature is released.

Really appreciate it ! Pls keep us informed. :)

@tanyunshi
Copy link
Author

Hello,
Do you have any update for this ? Thank you

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

4 participants