try
{
//kullandığın kodlar
}

catch (exception hata)
{
// hata verirse yapılacak kodlar;
Application.DoEvents();
continue; || break;
}