Last active
December 18, 2015 01:48
-
-
Save spg/5706518 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.fusesource.restygwt.client.Method; | |
import org.fusesource.restygwt.client.MethodCallback; | |
import com.google.gwt.user.client.Window; | |
public abstract class MethodCallbackImpl<T> implements MethodCallback<T> { | |
@Override | |
public void onSuccess(Method method, T result) { | |
onSuccess(result); | |
} | |
@Override | |
public void onFailure(Method method, Throwable throwable) { | |
String errorFromServer = method.getResponse().getText(); | |
showErrorMessage(errorFromServer); | |
} | |
protected void showErrorMessage(String serverError) { | |
Window.alert(serverError); | |
} | |
protected abstract void onSuccess(T result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This way, the client