当我尝试从onFailure方法抛出异常时,Android Studio强制我添加try catch块并且不允许向调用函数抛出异常。
protected void createUser(final UserRegister user) throws ApiException, RuntimeException {
Call call = dbApi.registerUserAsync(user, new ApiCallback<UserRegistered>() {
@Override
public void onFailure(ApiException e, int i, Map<String, List<String>> map) {
Timber.e("Exception in createUser: " + e.getMessage());
throw e;
}