I have had numerous times when an exception goes uncaught in my GUI code making it hard to determine what went wrong. To fix this, I am trying to use the Log.setUncaughtExceptionHandler() method in gwt-log so that any such exception would be caught and logged thus making debugging easier. See here for the feature I am trying to use and search for ‘setUncaughtExceptionHandler’.
Has any one gotten this working?
What is happening for me is that there is a window created to display logs that sits behind and overlapping my GUI. Is suspect this has something to do with the way windowing is handled in smartgwt. Has any one figured out the best way to use Log.setUncaughtExceptionHandler() method in gwt-log that overcomes the problem I mention?
SmartGWT has the relevant code from gwt-log (with the authors permission) to log such exceptions to System.err. See the source code for com.smartgwt.client.util.LogUtil.setJSNIErrorHandler(). This handler is called automatically so you should see the exceptions logged here. I have noticed that GWT 1.5+ does however swallow some exceptions (even non JSNI ones). I still haven’t gotten a full handle on this.
It is however desirable for users to be able to use gwt-log as well. The gwt-log window sits behing the GUI because the default gwt-log zindex is lower than that of SmartGWT. I’ve requested Fred to expose this zIndex allowing users to configure it to any value.
* Review the gwt-log.css file to see the CSS which is injected into your application by gwt-log
* Override the z-index (using !important if necessary) by adding a new rule to your application's CSS, e.g.
.log-panel {
z-index: 2000;
}
or
.log-panel {
z-index: 2000 !important;
}