Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to catch all errors regarding database in the application

Status
Not open for further replies.

Keendev

Technical User
Jan 23, 2006
106
PH

Hi,

What's the best way to catch all database error in your application? Im planning to put the script on my cfapplication, can the cfapplication will handle all errors?
pls advice and many thanks.


 
if using Application.cfc a good way to do that is with the

onError method.

Code:
<cffunction name="onError">
	<cfargument name="Exception" required="true" />
	<cfargument type="String" name="EventName" required="true" />
	<!--- Log all errors. --->
	<cfif arguments.exception.type EQ "database">
		<!--- do your code here --->
	</cfif>
	
</cffunction>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top