Exceptions

try ... throw ... catch

Examples

try {
      if (precondition not met)
            throw <some data>;
      else
            perform action;
}
catch (<some data type> <some data>) { ... }
catch (...) { ... } // Default case: catch (...)

Misc

  • Unhandled Exceptions will cause the program to terminate