Files
bodyshop-uploader/BodyshopUploader/Utils/ApplicationExceptionHandler.cs
2020-06-01 13:39:33 -07:00

25 lines
775 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BodyshopPartner.Utils
{
public static class ApplicationExceptionHandler
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public static void InitExceptionHandlers()
{
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
//do something with the file contents
}
public static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
logger.Fatal((e.ExceptionObject as Exception), "Unhandled generic exception. ");
}
}
}