32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
|
|
using System;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
using TBF.Forms;
|
|||
|
|
using TBF.Resources;
|
|||
|
|
|
|||
|
|
namespace TBF.ErrorHandler {
|
|||
|
|
|
|||
|
|
public static class ErrorHandler
|
|||
|
|
{
|
|||
|
|
public static DialogResult HandleError(Exception e, string Message, string Origin)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
//catch (FluentNHibernate.Cfg.FluentConfigurationException fe)
|
|||
|
|
// {
|
|||
|
|
// string message;
|
|||
|
|
// if (fe.InnerException != null)
|
|||
|
|
// {
|
|||
|
|
// message = fe.InnerException.Message;
|
|||
|
|
// }
|
|||
|
|
// else
|
|||
|
|
// {
|
|||
|
|
// message = fe.Message;
|
|||
|
|
// }
|
|||
|
|
// MessageBox.Show( message, "RetVal", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
|||
|
|
|
|||
|
|
ErrorDlg dlg = new ErrorDlg(Strings.Unhandled_error_occured_in_ + Origin + Environment.NewLine + Message + Environment.NewLine + e.ToString() + Environment.NewLine + e.InnerException.ToString());
|
|||
|
|
dlg.ShowDialog();
|
|||
|
|
return dlg.returnvalue;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|