exceptionCopy

Returns a copy of a caught exception as a struct, with keys such as message, detail, type, stackTrace and tagContext. The copy is a separate object from the exception.

exceptionCopy(exception) → returns struct

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

Argument Reference

exception any
Required

A caught exception, such as the variable in a catch block.

Compatibility

ColdFusion:

Version 2021+ Listed by getFunctionList() in ColdFusion 2021+. No official documentation exists. Signature and behavior confirmed on CF2021 and CF2025.

Examples
Sample code invoking the exceptionCopy function

try {
	throw(message="boom");
} catch (any e) {
	copy = exceptionCopy(e);
}
writeOutput(copy.message);

Expected Result: boom

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

Fork me on GitHub