Click to See Complete Forum and Search --> : Call Stack support


gorm
08-20-2003, 06:01 AM
Hi,

Someone seen an example of call stack support in IE? I'm trying to create a robust error handling for our app.

I use the onerror to recieve JavaErrors and I also got a class to handle exceptions (all errors are sent to the server using SOAP). I got different classes of exceptions and handling of them based on their severity.

My problem is that I am unable to track the call stack when ithe errorHandler is in another frame. Someone know a solution to this or got some other advice in implementing robus and meaningfull error messages on the client?

Is it possible to find the linenumber of where the exception occoured?

Also when I get the onerror line number this doesn't make much mening. Looks like it's ignoring included javascripts??

I target only IE 6 (an intranet application).

Thanks in advance for any answer.

Khalid Ali
08-20-2003, 08:02 AM
Interesting...I guess if you tried writing your own JavaScript application to trap exceptions and and at which line they might occur then it will be possible,however I can be wrong in saying the above as well..

gorm
08-20-2003, 08:06 AM
Is it possible to catch exceptions from some central place? I can get it in onerror, but then the error is only that a exception was throw'n without beeing catched and I haven't found a way of getting the original exception (custom exceptions, COM exceptions and java exceptions).

I got a very large javascript application and need to catch unexpected client errors.

A solution would be to write some c++ code that attach to the JavaScript engine of internet explorer, but I haven't look so much on this yet? Someone think this might be a good approach?

Khalid Ali
08-20-2003, 10:55 AM
Of course if you can write a plugin of sorts that will be an ideal situation because it will give you a low level control over any exception thrown.
However I have some custom exception handling routine at
this location. (http://www.webapplikations.com/pages/html_js/document/ExceptionHandlingJavaScript.html)

Take a look and see if that gives you some ideas.

gorm
08-20-2003, 12:06 PM
Thanks, but as I wrote, the application span many frames and there is not a natrual entry point to try/catch. I'm sorry, but your example is very trivial and didn't help me much.

I got a solution that works now, but it could be much better.

In my dreams I would like to create a global exception catch that support:

- a full call stack with "frameid", objectname and methodname
- the text of the line number that caused the exception to occour (in red) and the sourounding lines

Khalid Ali
08-20-2003, 12:14 PM
Of course its trivial...:-)
That was the intent to just adapt a genral approach to convey the concept,in your particular case,there is much work that needs to be done.
As you said you have several frames..you can implement the code and make changes to it to add line number and parent frame name or child frame name and all the other data in the exception and then as a general rule import this file in all pages which are in frames..I am sure that will work.

gorm
08-20-2003, 01:08 PM
Observations:
1.) Finding the caller of a function when the call stack cross frames doesn't work. IT only return undefined
2.) When a exception is thrown, you will only recieve a onerror stating that the exception was thrown

Need answer:
1.) Someone got a good idea on how to find the functionname of where the exception was called?
2.) Is it possible in some way from the custom onerror handler to find the original exception?