try/catch
Code that says "try this, and if that kind of failure happens, do this instead".
A try statement runs a block; its catch clauses handle exceptions of matching types thrown inside it, and its optional finally block runs however the try block exits.
Examples
try { qty = int.Parse(text); } catch (FormatException) { qty = 0; }falls back to 0 when the text isn't a number.
See also