Bug 395803 - Improve handling of javascript errors
Summary: Improve handling of javascript errors
Status: ASSIGNED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-05 05:11 EST by Tim Buschtoens CLA
Modified: 2014-05-15 09:00 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Buschtoens CLA 2012-12-05 05:11:51 EST
With the implementation of the protocol the javascript error handling has been much improved, as it is now possible to record during which operation an error occured. However, this does not help if the error occurs during the widget rendering ("flushGlobalQueues"), like in Bug 395667. In that case only the error message and the flush phase is displayed.

The following additonal information could be gathered:
- protocol id of the widget rendered, or (in case of subwidgets) of the parent
- classname of the widget
- protocol type of the widget or (in case of subwidgets) of the parent
- possibly the widgets outerHTML, states map, some essential property values

I think this could be achieved without destroying the errors stack-trace by storing the currently rendering widget in the Widget class (statics). 

Having this in 2.0 would be a really good idea!
Comment 1 Tim Buschtoens CLA 2014-05-15 09:00:50 EDT
I'll extend this bug instead of opening a new one:
We should also improve handling of non-criticical JavaScript errors.

We make a destinction between JS error thrown while parsing and rendering a server response, and other "non-critical" errors thrown during DOM events. (see ErrorHandler.processJavaScriptError.) Unlike what I remembered we already do not crash the client as a result of non-critical errors if the client is not in debug variant (which is practically always the case for me). The error is only printed to the console. There are some improvements that would be useful here:

- Some DOM events are not caught by processJavaScriptError (e.g. unload events, scroll, events, certainly some more), which may cause the browser (depending on the settings) to display an error window of it's own. We should capture all those.
- Some errors during response evaluation/rendering may be non-critical too, but they are all handled as critical. We should look to capture those with processJavaScriptError too.