How it works...

One must differentiate between an error and an exception. An error is a programming error and must be handled by a programmer. It represents certain assumptions or a case that is not handled. Exceptions, on the other hand, should be extremely rare and raised because of external factors rather than the program.