aspose 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

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.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    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
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

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: 15357
    
    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
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

That worked! Thanks Eric.
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

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: 15357
    
    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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Displaying Errors on Ajax return function.
 
Similar Threads
Proper way to define a JavaScript Object
"Unterminated <c:out tag" Error
Loading Progress Bar
Submit dynamically created form with jQuery
calling a bean function using jstl