私は試した
public void onFailure(Throwable caught) {
Throwable cause = caught.getCause();
String causeStr = (cause==null) ? "" : ", "+cause.getMessage();
errorLabel.setText(SERVER_ERROR + ": " + caught.getMessage() + causeStr);
しかし、原因は常に null であり、caught.getMessage()
常に非常に一般的な500 The call failed on the server; see server log for details
. サーバーから IllegalArgumentExceptions をスローし、それをクライアントに表示できるようにしたい:
throw new IllegalArgumentException("Email address is invalid.");