3

I'm using SmartGWT with RestDataSource. Whenever I lose internet connection, I get an SC.warn window with:

Server returned TRANSPORT_ERROR with no error message

I have tried to intercept this message to create a more friendly message, by adding a Callback handler for RPCManager like so:

RPCManager.setHandleTransportErrorCallback(new HandleTransportErrorCallback() {

    public void handleTransportError(int transactionNum, int status,
        int httpResponseCode, String httpResponseText) {

        System.err.println("Transaction number: "+transactionNum);
        System.err.println("Status: "+status);
        System.err.println("Response code: "+httpResponseCode);
        System.err.println("Response text:"+httpResponseText);

        SC.warn("You have no internet connection.");

        }
    });

However, the Error messages print, and my warn message shows, but so does the system warn message above!

Keep in mind that I'm using a RestDataSource and not directly connecting to server with RPCManager.

How can I intercept this error message?

Thanks

Kwame
  • 1,115
  • 2
  • 21
  • 38

1 Answers1

2

Try instead RPCManager.setHandleErrorCallback(..).

Peter Knego
  • 79,991
  • 11
  • 123
  • 154