Azure-webjobs-sdk: Azure webhook function: Exception-handling

Created on 11 Oct 2017  路  5Comments  路  Source: Azure/azure-webjobs-sdk

I'm working on exception-handling in my Azure webhook function.
I would like to be able to catch all exceptions in a filter and return a default response (something like req.CreateResponse(HttpStatusCode.InternalServerError);) from my webhook.

Is such a task ment for FunctionExceptionFilterAttribute, and how do i get the request/response from the context? Or is it another way to do this in a webhook azure function?

Most helpful comment

@mathewc is this possible?

All 5 comments

Have you tried using exception filters as discussed here?

Yes, that was what i reffered to in my initial comment. There is nothing there that makes it possible to access the request/response object :-/

@mathewc is this possible?

@mathewc is this possible?

+1 - I agree that without the ability to return a certain result object, such as BadRequestObjectResult based on the exception, the FunctionExceptionFilterAttribute isn't overly useful.

Was this page helpful?
0 / 5 - 0 ratings