Using Adobe ColdFusion version 8 and below, all my cfqueries are wrapped in a try catch that calls a function in database.cfc called "CatchError".
<cftry>
<cfquery datasource="myDatasource">
UPDATE TableName SET
...
WHERE ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.ID#">
</cfquery>
<cfcatch>
<cfset local.result = Variables.objDatabase.CatchError(cfcatch)>
</cfcatch>
</cftry>
Q1: Is there a good general purpose error catcher that's been written that takes into account all the different exception types (Any, Application, Database, Expression, Lock, MissingInclude, Object, Security, Template and SearchEngine)?
Q2: I'm thinking I would like to log these errors as well, maybe not to a text file but to a database. Of course, you see the problem with that...logging database errors in the database...
Q3: And I might want to email someone if it's this session's first error.