retrofit2 errorbody.content无法访问

问题描述 投票:0回答:3

我是retrofit2世界的新手,目前我遇到了从onNext获取错误的问题。

这是我的示例代码:

 public void onNext(Response<LoginResponse> value) {
      ResponseBody responseBody = value.errorBody();
      String sam = responseBody.toString();
 }

我的问题是,我无法得到errorbody()。内容。它就像它无法访问。

enter image description here

android retrofit2 rx-java2 rx-android
3个回答
© www.soinside.com 2019 - 2024. All rights reserved.