All Manuals > LispWorks® User Guide and Reference Manual > 39 The LW-JI Package

java-method-exception Condition Class

Summary

Conditions signaled when an exception occurs inside a call to a Java method or constructor.

Package

lw-ji

Superclasses

java-normal-exception

Readers

java-method-exception-name
java-method-exception-class-name
java-method-exception-method-name
java-method-exception-args

Description

Instances of the condition class java-method-exception are signaled when an exception occurs inside a call to a Java method or a constructor. Such exceptions are normal behavior for Java, so these exceptions should in general be handled somehow.

The java-exception accessors (java-exception-exception-name, java-exception-string) can be used on a java-method-exception and are useful for simple handling. For more complex handling, you can use catching-java-exceptions around pieces of your code, and then look at the actual Java exception.

The reader java-method-exception-name returns the name of the Java caller (a Lisp symbol) that caused the exception.

The reader java-method-exception-class-name returns the Java class name of the method or constructor.

The reader java-method-exception-method-name returns the method name if the exception is inside a method, or nil if the exception is inside a constructor.

The reader java-method-exception-args returns the arguments that were passed to the caller.

See also

catching-java-exceptions
java-exception


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:46