For very simple programs it is probably easy to make sure all program parts do exactly what they are supposed to. For programs with a higher level of complexity, those built by many developers, or those that use external programs (libraries), the situation is not that clear. Problems will arise, for example, if lists or arrays get addressed out of bounds, some I/O access to files or network data streams fails, or objects end up in an unanticipated or corrupted state.
This is what exceptions are for. Exceptions are objects that get created or thrown if something unanticipated ...