File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Displaying Errors on Ajax return function. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Displaying Errors on Ajax return function." Watch "Displaying Errors on Ajax return function." New topic
Author

Displaying Errors on Ajax return function.

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Maybe I am doing something wrong, but...

Let's say I have the following (psuedo code)



In someCallBackFunction, if there is a javascript error, the browser never reports it. Very hard to debug. I've tried overriding the window.onerror but I don't believe that is even being thrown. So how would I go about dealing with this?

Thanks.


GenRocket - A Test Data Generation Platform
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
How do you know an error occurs if it is not being reported? That is the answer I want to know. lol

Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Because the page just stops. I can put alert messages in the function and move them until they don't display. Then I kind of know where the error is. For example:



The last alert never happens. But the browser doesn't report the problem with the variable c.
[ May 02, 2006: Message edited by: Gregg Bolinger ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
With all of my fucntion I use try catch statements which are logged to my server. Here is a basic exacmple that shows you basic functionality with try catch



See if that catches it.

Eric
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

That worked! Thanks Eric.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Ok, so I have e.message, e.description, e.name... I am trying to find the other methods available, if any. Google hasn't turned up anything yet. Anyone know where I would find these defined?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
that is all you are going to get.

Loop through the properties of e to see it by using for in

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying Errors on Ajax return function.
 
Similar Threads
Proper way to define a JavaScript Object
Loading Progress Bar
calling a bean function using jstl
"Unterminated <c:out tag" Error
Submit dynamically created form with jQuery