Messenger/MSGer.tk (C#)/ErrorHandling.cs

42 lines
1.5 KiB
C#
Raw Normal View History

2014-04-25 21:55:43 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MSGer.tk
{
class ErrorHandling
{
public static void FormError(Form fname, Exception e)
{
MessageBox.Show(e.GetType().ToString());
if (fname == Program.MainF)
{
switch (e.GetType().ToString())
{
2014-07-12 08:53:00 +00:00
/*case "System.NullReferenceException":
2014-04-25 21:55:43 +00:00
MessageBox.Show("lol");
2014-07-12 08:53:00 +00:00
break;*/
2014-04-25 21:55:43 +00:00
default:
MessageBox.Show("Ismeretlen hiba történt (" + e.GetType().ToString() + ")!\n\nForrás: " + e.Source + "\nA hibaüzenet: \n" + e.Message + "\nEnnél a műveletnél: " + e.TargetSite);
break;
}
}
else if(fname==MainForm.LoginDialog)
{
switch (e.GetType().ToString())
{
2014-07-12 08:53:00 +00:00
/*case "System.NullReferenceException":
2014-04-25 21:55:43 +00:00
MessageBox.Show("lol");
2014-07-12 08:53:00 +00:00
break;*/
2014-04-25 21:55:43 +00:00
default:
MessageBox.Show("Ismeretlen hiba történt (" + e.GetType().ToString() + ")!\n\nForrás: " + e.Source + "\nA hibaüzenet: \n" + e.Message + "\nEnnél a műveletnél: " + e.TargetSite);
break;
}
}
}
}
}