Skip navigation links

Package com.perforce.p4java.exception

Provides exception and error classes for signaling and handling user, internal, and Perforce server errors.

See: Description

Package com.perforce.p4java.exception Description

Provides exception and error classes for signaling and handling user, internal, and Perforce server errors.

P4Java uses a fairly standard set of extensions to java.lang.Exception to signal recoverable errors, but it also uses extensions to java.lang.Error to signal unrecoverable errors that it's detected itself (such as null pointers or out-of-range values). Since they're defined as extensions to Error, they're not typically declared in method "throws" clauses, which means users are free to ignore them in the same way that they can ignore non-P4Java Error throwables.

However, if you wish to keep control in the face of all possible errors, it's probably a good idea to keep an outer catch block for P4JError catching as well as other exceptions and throwables — P4Java does not throw such errors lightly, only for conditions that show a serious programming error (either internally or by the user).

Skip navigation links