Rick if there is an error being thrown then the log files are important
here.

An other thing to note is that it might pay to look at something like this.

http://www.andyscott.id.au/2011/8/27/ColdFusion-and-Remote-Calls-and-notifying-the-caller-of-the-problem

This is how I handle all Ajax calls, so that the client can then decide on
what to do if it succeeds or fails. So in the case of a failure you could
then display a human readable error or notification that could be reported
to you, but the biggest part of this entire equation will be error logging
using the <cflog /> or even emails for sending important information if
need be.


-- 
Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/
Google+: http://plus.google.com/108193156965451149543



On Wed, May 2, 2012 at 3:48 AM, Rick Faircloth <r...@whitestonemedia.com>wrote:

>
> Looks like a good solution for getting some error clues
> back from AJAX calls. I'll have to work on translating
> this into jQuery. Usually, I can find some CF error code
> in the iFrame used to process the file uploads, but nothing
> is appearing there, or in the JSON reply.
>
> Thanks for the tip!
>
> Rick
>
> -----Original Message-----
> From: Claude Schnéegans <schneeg...@internetique.com>
> [mailto:=?ISO-8859-1?Q?Claude_Schn=E9egans <schneegans@interneti=71?=
> =?ISO-8859-1?Q?ue.com=3E?=]
> Sent: Tuesday, May 01, 2012 1:13 PM
> To: cf-talk
> Subject: Re: Anyone see anything wrong with this code?
>
>
> »>>I can't give any clues on error messages, because this
> is part of a cfc on the back end of an ajax call.
> No errors show up in firebug or elsewhere.
>
> This is a problem with Ajax calls.
> If the template called by Ajax throws an error, the text returned by the CF
> server is not compatible with Ajax and it causes an Ajax error. This error
> will not help, what one is intersted in is the error in the CF error.
>
> I've developped my own Ajax call function, and in case of error, it will
> open a new window with the whole text returned in it. Generally, it is the
> error generated by CF.
> This one is for POST method, but I have the equivalent for GET:
> If there is anything wrong, the function calls displayError to displat the
> text actually received.
>
> function ajaxPOST (url, sendText)
>   {
>   var XMLHttp = null;
>     if (window.XMLHttpRequest)XMLHttp = new XMLHttpRequest();
>     // code for MSIE
>     else if (window.ActiveXObject)XMLHttp = new
> ActiveXObject("Microsoft.XMLHttp");
>   if(XMLHttp)
>     {
>     XMLHttp.open("POST", url, false);
>     XMLHttp.setRequestHeader("Content-Type",
> "application/x-www-form-urlencoded; charset=iso-8859-1");
>     XMLHttp.send(sendText);
>     if (XMLHttp.status == 200)return XMLHttp.responseText;
>     displayError("<H2>" + XMLHttp.statusText + "</H2><P>" +
> XMLHttp.responseText)
>     return null;
>     }
>     else return null;
>   }
> function displayError(text)
>     {
>     var errorWin = open
> ("","Error","scrollbars=yes,resizable,width=900,height=600");
>     errorWin.document.open();
>     errorWin.document.write(text);
>     errorWin.document.close();
>   errorWin.focus()
>     }
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:350934
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to