Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

error message from database stored procedures

Engaged ,
Nov 08, 2013 Nov 08, 2013

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,

588
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 08, 2013 Nov 08, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 09, 2013 Nov 09, 2013
LATEST

Thanks a million for the information and help,

Regards,

Iccsi,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources