Handling errors
The exception handling process in a .NET-based Function App is similar to any other .NET application. Best practices for handling exceptions in .NET can be found at the following two links:
We will not elaborate on best practices further in this book.
Let us, instead, outline the error handling in Functions Core tools local environment for two cases--handled and unhandled exceptions.
To demonstrate exception handling, let us create another timer-triggered function called ErrorFunction
. To do so, follow the same steps as in the previous section on creating the test
function, and move on to the following steps:
- When the function is created, open the
ErrorFunction.cs
file, and paste the following code. As you can see, the following code generates an unhandled exception:
using System; using Microsoft...