fix: 修正用户访问失败时的返回处理

This commit is contained in:
eggmanQQQ
2024-08-06 19:27:00 +08:00
parent 154e688673
commit 0bc1023c99
3 changed files with 10 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
@@ -307,6 +308,9 @@ public final class UserModel extends BaseModel implements IUserModel {
if (null == userDetailInfo) {
return Single.error(new Exception(ResUtil.getString(R.string.xchat_android_core_user_usermodel_06)));
}
if (userDetailInfo.getCode() != 200) {
return Single.error(new Exception(userDetailInfo.getMessage()));
}
return Single.just(userDetailInfo);
});
}