logical errors are quite hard to fix because the problem isn' with the actual codeyet the code itself is incorrectly defined the thought process that went into creating the code is faultythereforethe developer who created the error is less likely to find it smart developers use second pair of eyes to help spot logical errors having formal application specification also helps because the logic behind the tasks the application performs is usually given formal review catching exceptions generally speakinga user should never see an exception dialog box your application should always catch the exception and handle it before the user sees it of coursethe real world is different -users do see unexpected exceptions from time to time howevercatching every potential exception is still the goal when developing an application the following sections describe how to catch exceptions and handle them understanding the built-in exceptions python comes with host of built-in exceptions -far more than you might think possible you can see list of these exceptions at library/exceptions html the docu mentation breaks the exception list down into categories here is brief overview of the python exception categories that you work with regularlybase classesthe base classes provide the essential building blocks (such as the exception exceptionfor other excep tions howeveryou might actually see some of these exceptionssuch as the arithmeticerror exceptionwhen working with an application concrete exceptionsapplications can experience hard errors -errors that are hard to overcome because there really isn' good way to handle them or they signal an event that the application must handle for examplewhen system runs out of memorypython generates memoryerror exception recovering from this error is hard because it isn' always possible to release memory from other uses when the user presses an interrupt key (such as ctrl+ or delete)python gener ates keyboardinterrupt exception the application must handle this exception before proceeding with any other tasks os exceptionsthe operating system can generate errors that python then passes them along to your application for exam pleif your application tries to open file that doesn' existthe operating system generates filenotfounderror exception warningspython tries to warn you about unexpected events or actions that could result in errors later for exampleif you try to inappropriately use resourcesuch as an iconpython generates resourcewarning exception it' important to remember that this particular category is warning and not an actual errorignoring it can cause you woe laterbut you can ignore it