This chapter explains how to handle run-time errors — errors that occur while your code is running. A run-time error occurs when your code attempts to perform an invalid operation, such as opening a file that was deleted, using a property that doesn't exist, or setting the value of a read-only property. Although you can prevent many run-time errors by being careful and thorough when writing and checking your code, there will always be a potential for unforeseeable errors cropping up. To prevent one of these unexpected errors from stopping your code prematurely and leaving your data in an unpredictable state, you can add error-handling code to your procedures.