Chapter 3. Errors and Exceptions

Errors and Exceptions

This chapter details Jython’s built-in exceptions and related mechanisms. The topic of exception objects also invites a closer study of the try/ except statement, raise statement, traceback object, assert statement, _ _debug__ variable, and the recently added warnings framework.

Jython Exceptions

Jython’s exceptions are defined in the class org.python.core.exceptions. The source for this class contains a hierarchy of the exceptions that is shown in Figure 3.1. Each exception’s corresponding message string is included following the class name in this image.

Figure 3.1. Jython’s exception hierarchy.

You cannot divide ...

Get Jython for Java Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.