你好我在GWT中有一段代码,我的一位资深大学写过这段代码。
public void onFailure(Throwable caught) {
if (caught instanceof RuntimeException) {
if (caught instanceof StatusCodeException
&& caught.getMessage().contains(
"<title>Error 500 unAuthorized</title>")) {
MessageBox
.alert("Session has been expired. Press Ok to redirect to Login page.");
History.newItem(HistoryToken.INDEX_PAGE.toString());
} else {
MessageBox
.alert("An exception has occured.Press Ok to continue.");
}
} else if (caught instanceof InvocationException) {
MessageBox
.alert("Sorry... Some error occured while reaching to server.");
}
}
在服务器上呼叫失败时执行else if (caught instanceof InvocationException) {
阻止的可能性有多大?
我认为else if (caught instanceof InvocationException)
无论如何都不会被执行。
有什么建议吗?