exeptions in WFA

This commit is contained in:
test
2019-04-06 14:10:00 +02:00
parent 1a44661209
commit 5cfbf8d0a5
9 changed files with 21 additions and 15 deletions

View File

@ -183,7 +183,22 @@ namespace WindowsFormsApp01
private void Button4_Click(object sender, EventArgs e)
{
calc.CalcIt();
try
{
calc.CalcIt();
}
catch (DivideByZeroException)
{
label4.Text = "Fehler: div by zero";
}
catch (Exception)
{
label4.Text = "Fehler";
}
}
public void CalcFinished(CalcEventArgs e)
@ -214,6 +229,7 @@ namespace WindowsFormsApp01
{
int res = DateTime.Now.Second;
res = res / 0;
var e = new CalcEventArgs(res);
//trigger handler