bugsnag / bugsnag-dotnet

.NET notifier for BugSnag. Error monitoring and error reporting for .NET.
https://docs.bugsnag.com/platforms/dotnet/
MIT License
60 stars 29 forks source link

PLAT-5359] Assume default behaviour for UnobservedTaskExceptions when app.config does not exist #135

Closed yousif-bugsnag closed 3 years ago

yousif-bugsnag commented 3 years ago

Goal

for .NET 4.5 Bugsnag attempts to load the App.config file to read the value of the ThrowUnobservedTaskExceptions element and this crashes with a FileNotFoundException if there is no App.config file. This PR guards against App.config not existing

Design

Make sure that the file exists before loading, and assume the default behaviour (UnobservedTaskExceptions do not terminate the process) if the config file doesn't exist.

Changeset

Added a File.Exists check to UnhandledException#DetermineUnobservedTerminates

Testing

Ran the unit tests and tested manually using the example apps in the repository