I have a ColdFusion cfm file that communicates with a sql server database. Right now if something goes wrong with the database connection, it brings up an error page generated by ColdFusion. Is there a way I can catch the errors and display a message like, “Database server temporarily down, please come back later”?
Ted
I have a ColdFusion cfm file that communicates with a sql server database. Right
Share
You can use try/catch for an individual query – this will be the most granular approach.
You can also use the cferror tag for global exception handling (put this in Application.cfm):
You can also use onError method within Application.cfc, which will also (like the cferror tag) catch all errors that occur during the request: