Not sure where this goes in CF5.5. Place it in your error handler.

               <!---if the request is ajax, throw an error that can be
returned to the client in a basic string and then log the error as usual--->
               <cfset requestHeaders = getHTTPRequestData().headers>
            <cfif  StructKeyExists(requestHeaders, "X-Requested-With") and
StructFind(requestHeaders,"X-Requested-With") eq "XMLHttpRequest">
                <!--- If you want to view the error in firebug dump the
error here--->
                <cfheader statusCode="500" statusText="ColdFusion Error">
                <cfabort>
            </cfif>





In your js document:

$.ajaxSetup({
    error:function(x,e){
       if(x.status == 500 && x.statusText == "ColdFusion Error"){
            //Server side code issue. Handle it gracefully!

        }
});

You probably want to handle all server errors the same, although you can
customize the messages returned to the client. For instance, if you get a
SQL error you can do <cfheader statusCode="500" statusText="JDBC Error">
instead.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339116
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to