ColdFusion · Exception

Application: the default cfcatch type, and a common source of missed errors

What does Application: the default cfcatch type, and a common source of missed errors mean in ColdFusion?

A cftry/cfcatch block with no type attribute specified only catches exceptions of type Application, not every exception the try block could raise. Database, Expression, and other typed exceptions pass straight through an untyped cfcatch instead of being caught by it.

Application: the default cfcatch type, and a common source of missed errorsAdobe ColdFusion · Lucee

Condition

A cftry/cfcatch block with no type attribute specified only catches exceptions of type Application, not every exception the try block could raise. Database, Expression, and other typed exceptions pass straight through an untyped cfcatch instead of being caught by it.

Fix

If a cftry block does not seem to be catching an error you know is happening, check whether the cfcatch tag specifies a type at all. Use type="any" deliberately when the intent really is to catch everything, rather than relying on the default.

Pending source verification. Not yet checked against official documentation.

Related exception