House of Fusion
Home of the ColdFusion Community
Hostmysite ColdFusion Hosting

Search ajax

August 30, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
           1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31             

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  Ajax

Handling of ColdFusion error?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Are you using CFAJAX or another framework?
James Holmes
11/03/05 07:49 P
Using CFAjax at this point.
Jeff D. Chastain
11/03/05 07:56 P
> -----Original Message-----
Jim Davis
11/04/05 04:03 P

11/03/2005 11:16 AM
Author:
Jeff D. Chastain

I am just beginning to look into AJAX, so bear with me if this is completely obvious.  If the CF function that is called via JS/AJAX throws an error, where does that error go?  Is it possible to capture that error and bring it to the interface? Thanks -- Jeff

11/03/2005 07:49 PM
Author:
James Holmes

Are you using CFAJAX or another framework? If CFAJAX, http://jr-holmes.coldfusionjournal.com/cf_errors_in_cfajax.htm On 11/4/05, Jeff D. Chastain <lists@admentus.com> wrote: > I am just beginning to look into AJAX, so bear with me if this is completely > obvious.  If the CF function that is called via JS/AJAX throws an error, > where does that error go?  Is it possible to capture that error and bring it > to the interface?

11/03/2005 07:56 PM
Author:
Jeff D. Chastain

Using CFAjax at this point. Thanks. Are you using CFAJAX or another framework? If CFAJAX, http://jr-holmes.coldfusionjournal.com/cf_errors_in_cfajax.htm On 11/4/05, Jeff D. Chastain <lists@admentus.com> wrote: > I am just beginning to look into AJAX, so bear with me if this is > completely obvious.  If the CF function that is called via JS/AJAX > throws an error, where does that error go?  Is it possible to capture > that error and bring it to the interface?

11/03/2005 11:30 PM
Author:
Charlie Arehart

Well, think about it: the ajax client code within the browser (typically an xmlhttprequest object) is talking to the server. It (the client code) is expecting some specifically formatted result (could be you wrote it to expect xml, or perhaps a simple value), but it's not likely expecting a bug hunk of HTML, right? But what will CF (or BlueDragon) return if an error occurs? It's HTML, right? (Of course, to us viewing the page in the browser it shows a nicely formatted error message, but if you think about it, it's HTML.) So you have two problems. You ask, "where does it go"? It goes back to the ajax client. It's just that unless you write the client to expect and process HTML, it will "seem to disappear" or "do nothing". It's just not getting what it expects. So how can you solve this, if you're using a client that you don't/can't control? Well, your CF logs will be one way to know what's going on (CF writes errors to its application.log file). You could also set up error handling, to do more on an error, like email you about it (classic CFML error handling stuff), and you could even write it to send something more meaningful to the ajax client. Hope that helps. Charlie Arehart CTO, New Atlanta Communications, makers of BlueDragon (678) 256-5395 charlie@newatlanta.com www.newatlanta.com/bluedragon/

11/04/2005 03:54 AM
Author:
James Holmes

On 11/4/05, Charlie Arehart <charlie@newatlanta.com> wrote: [snip] > > So how can you solve this, if you're using a client that you don't/can't > control? Well, your CF logs will be one way to know what's going on (CF > writes errors to its application.log file). You could also set up error > handling, to do more on an error, like email you about it (classic CFML > error handling stuff), and you could even write it to send something more > meaningful to the ajax client. That's what my technique (for CFAJAX) does - it uses CF error handling to pass meaningful JS back to the browser via the CFAJAX engine.

11/04/2005 04:03 PM
Author:
Jim Davis

> -----Original Message----- Sure - just as you can output HTML or whatever when an error occurs you can output XML in whatever dialect you're using and send that to the client. As a shameless plug I'll also say that this is REALLY simple in YODEL since the JavaScript deserializer easily allows for custom handlers.  So your error might have a custom type of "error" and, on the client, you could have a custom handler for "error". This handler might throw an error to the client, recall a data fetcher, log it or whatever you like. You can find out more about YODEL here: http://www.depressedpress.com/Content/Development/YODEL/Index.cfm And get JavaScript and CF libraries for using it (both of which support custom handlers) here: http://www.depressedpress.com/Content/Development/YODEL/Implementations/Inde x.cfm Of course while it's easy in YODEL it's not really hard in anything else. But please use YODEL!  ;^) Jim Davis

12/18/2005 02:23 PM
Author:
Todd Kingham

I can't stress this enough.... If you are writing AJAX you NEEEEEED to get a good HTTP Packet Sniffer. It's like a crystal ball for your code ;) In reading through a ton of AJAX posts I never hear this topic come up, but for me it is an invaluable tool in AJAX development. Not only can you read the CF Errors when they come back but it gives you an insight into download times and bandwidth useage, etc..... There are a bunch out there but the best one I have used is from IE Inspector. It is awesome! But if you are not in the market for one you have to buy there are some free ones out there that work well. I have a list to several on my site at the following URL: http://www.lalabird.com/jsmx/?fa=JSMX. downloads HTH, Todd >I am just beginning to look into AJAX, so bear with me if this is completely >obvious.  If the CF function that is called via JS/AJAX throws an error, >where does that error go?  Is it possible to capture that error and bring it >to the interface? > >Thanks >-- Jeff


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists