Announcement

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

    Custome error handling

    Hi,

    I was following the suggestion of this page

    http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/docs/ErrorHandling.html

    I need to have custom error handling of our DSRequest calls. But somehow it does not work. The code for custom error handling in the callback class was not called. Instead, there was a pop-up box for the error (I think that came from the default handling of SmartGWT)

    My client code:

    Code:
    DSRequest properties = new DSRequest();
    properties.setWillHandleError(true);
    ds.performCustomOperation(
            "rGenQuery"
            , new Record()
            , dsCallback
            , properties
            );
    Our callback class was defined like this

    Code:
    DSCallback dsCallback = new DSCallback() {
        public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
            int respStatus = dsResponse.getStatus();
            if (respStatus>0) {
                // ... normal processing
            } else if (respStatus==-400) {
                // custome handling of error -- but was not invoked when error occurred
            }
    
        }
    };
    The server signals this error condition by using DSResponse.setStatus() with a code of -400. Something like

    Code:
    return (new DSResponse().setStatus(-400));
    The webpage above cited an exception case for transport error (that handleTransportError() will always be called). Would the status code of my choice (-400) be interpreted as a transport error? But I also tried -101 and the result was the same.

    #2
    By the way, we were using the following for the above test

    1. SmartClient Version: v8.3p_2013-01-15/PowerEdition Deployment (built 2013-01-15)

    2. Browser: Firefox 23.0.1

    Comment


      #3
      This has been assigned to a developer for investigation

      Regards
      Isomorphic Software

      Comment


        #4
        I am very sorry. The problem was due to some stupid error on my side. The mechanism actually works.

        And code -400 was perfectly okay. Just found this page, transport error has the code of -90

        http://www.smartclient.com/smartgwt/javadoc/constant-values.html

        Thanks a lot!

        Comment

        Working...
        X