Skip to main content
Inspiring
November 8, 2013
Question

error message from database stored procedures

  • November 8, 2013
  • 1 reply
  • 643 views

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,

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    November 8, 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.

    iccsiAuthor
    Inspiring
    November 9, 2013

    Thanks a million for the information and help,

    Regards,

    Iccsi,