Used with the cftry and cfcatch tags. Retrieves a Java
exception object from a Java object.

getException(javaobject) → returns any

This function requires Adobe ColdFusion.  Not supported on Lucee, etc.

Argument Reference

javaobject any

Sample code invoking the getException function

Renders map of exception data, when trying to access a non-existent element in an ArrayList.

arrayList = createObject("JAVA", "java.util.ArrayList").init();
try {writeDump(arrayList.get(2));}
catch(java.lang.IndexOutOfBoundsException _) {

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub