What To Do When Errors Occur
In a Utopian world, an error would never disrupt any program that you write. Anyone who is honest about the reality of real-world programming has to admit that programs, regardless of how carefully they are written, have errors from time to time. Because this is indisputable, is it not in your best interest to add error-handling routines to your procedures?
Let’s examine some of the options that are open to you when an error occurs:
Ignore it in your program by having no error handling whatsoever
Ignore it in your program with error handling that resumes the program while bypassing the error
Handle the error in your program by trapping the error, pausing the program, and giving the user an error message with the option ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access