Hi Team,
I am using :
SmartClient Version: v11.1p_2017-07-24/PowerEdition Deployment (built 2017-07-24)
In my smartGWT application, i have three scenarios:
1. Session timeout occurs. In this case, whenever a request is fired i get an error "The server failed to return a formatted response at all."
2. The host is unreachable at an IP level (eg VPN disconnect.) In this case i get an error "Transport error - HTTP code: 0 for URL:"
3. A reload happens in the middle of a request being sent. Then i get an error "Transport error - HTTP code: 0 for URL:".
I want to show appropriate error in each case. Like "session timeout" in 1, and "Unable to connect to server" in case of 2. No message in case of 3.
If i use the LoginRequiredMarker like below, i get "Session Time Out" in all cases.
RPCManager.setLoginRequiredMarker("loginRequiredMarker");
RPCManager.setHandleErrorCallback(new HandleErrorCallback() {
@Override
public void handleError(DSResponse response, DSRequest request) {
final Dialog dialog = new Dialog();
dialog.setShowCloseButton(false);
dialog.setMessage("Session Time Out");
Button button = new Button("OK");
dialog.setButtons(button);
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.Location.assign(Window.Location.getPath());
dialog.hide();
}
});
dialog.draw();
}
});
How can i handle the cases differently. Please help
I am using :
SmartClient Version: v11.1p_2017-07-24/PowerEdition Deployment (built 2017-07-24)
In my smartGWT application, i have three scenarios:
1. Session timeout occurs. In this case, whenever a request is fired i get an error "The server failed to return a formatted response at all."
2. The host is unreachable at an IP level (eg VPN disconnect.) In this case i get an error "Transport error - HTTP code: 0 for URL:"
3. A reload happens in the middle of a request being sent. Then i get an error "Transport error - HTTP code: 0 for URL:".
I want to show appropriate error in each case. Like "session timeout" in 1, and "Unable to connect to server" in case of 2. No message in case of 3.
If i use the LoginRequiredMarker like below, i get "Session Time Out" in all cases.
RPCManager.setLoginRequiredMarker("loginRequiredMarker");
RPCManager.setHandleErrorCallback(new HandleErrorCallback() {
@Override
public void handleError(DSResponse response, DSRequest request) {
final Dialog dialog = new Dialog();
dialog.setShowCloseButton(false);
dialog.setMessage("Session Time Out");
Button button = new Button("OK");
dialog.setButtons(button);
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.Location.assign(Window.Location.getPath());
dialog.hide();
}
});
dialog.draw();
}
});
How can i handle the cases differently. Please help
Comment