Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Handling exception on ServLet (RemoteServiceServlet) constructor

    Hi,

    When a exception occurs inside a gwt servlet constructor, the browser is showing the exception in a MessageBox (like when calling SC.say()) with all the stack trace in it. The message box is huge, and in some cases the user can't read the message, because it is bigger than the available screen.

    So, I want to deal with those exceptions.

    How can I intercept in the client side a exception raised inside the servlet constructor?

    When a exception ocurrs outside the constructor I'm proper dealing with it, because it is catch by the onFailure() method of the GWT AsyncCallBack.

    But, when the exception is inside the servlet constructor, how can I catch it in my code?

    I've tried to put in the onModuleLoad of my GWT EntryPoint:
    Code:
            GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler()
            {
    
                @Override
                public void onUncaughtException(Throwable p_throwable)
                {
                    LfwClientUtil.TreatException(p_throwable);
    
                }
            });
    But the onUncaughtException method is not being called when the exception is raised in the servlet constructor.

    and also tried the following, to see if the exceptions is printed directly to the browser (as said in the GWT JavaDoc), but it is still being shown inside the SmartGwt MessageBox.:
    Code:
    GWT.setUncaughtExceptionHandler(null)
    Thanks,
    Cerávolo

    #2
    See RPCManager.handleError.

    Comment

    Working...
    X