try { <something> } catch(problem_type ¶meter) { <do something this specific kind of exception> } catch(...) { <do something to catch any other exceptions> }
In the code, generate an exception:
throw <problem_type>