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:
Our callback class was defined like this
The server signals this error condition by using DSResponse.setStatus() with a code of -400. Something like
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.
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 );
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 } } };
Code:
return (new DSResponse().setStatus(-400));
Comment