try { ... } catch (Exception) { // Yeah, this looks stupid, but avoids compiler warnings about unreachable code bool err = true; if (err) return; }