• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying Errors on Ajax return function.

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That worked! Thanks Eric.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that is all you are going to get.

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

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic