0
你好,我在GWT有一段代碼,我的一位高級同事寫了這段代碼。Handlling 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)
在任何情況下都不會被執行。 有何建議?
感謝您的回覆。這傢伙離開了這家公司。 – 2011-03-16 11:30:48