getException

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

getException(object) → returns any

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

Argument Reference

object any
Required

Examples
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 _) {
    writeDump(getException(arrayList));
}

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

Fork me on GitHub