Copy link to clipboard
Copied
I would like to have some error message show at client side from stored procedures.
I use MS SQL Server and use RAISEERROR, but ColdFusion does not bring the error message just ignore the error continue to run the other part of code.
I just want to know are there any way to bring stroed procedure error message to client, or I have to trap the error at Web Server or JavaScript level.
Your help and information is great appreciated,
Regards,
Iccsi,
Copy link to clipboard
Copied
Just wrap your cfstoredproc in a cftry/cfcatch. See this for an example:
http://stackoverflow.com/questions/1879754/accessing-raiseerror-message-from-cfstoredproc
There's no way your javascript can trap this server-side error though, unless you were calling your CFM page that calls the stored proc via an AJAX request.
Copy link to clipboard
Copied
Thanks a million for the information and help,
Regards,
Iccsi,