|
@@ -166,10 +166,14 @@ public class FeiShuService {
|
|
|
log.warn("个人账号[{}]被禁用,尝试下一个", account.getAppId());
|
|
log.warn("个人账号[{}]被禁用,尝试下一个", account.getAppId());
|
|
|
} else if (code != null && (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code))) {
|
|
} else if (code != null && (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code))) {
|
|
|
log.warn("个人账号[{}]可重试错误,切换下一个", account.getAppId());
|
|
log.warn("个人账号[{}]可重试错误,切换下一个", account.getAppId());
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else if (code != null) {
|
|
|
|
|
+ // 明确的业务错误码,终止
|
|
|
recordLinkError(param.getVideoId(), param.getCompanyId(), param.getCourseId(),
|
|
recordLinkError(param.getVideoId(), param.getCompanyId(), param.getCourseId(),
|
|
|
param.getCompanyUserId(), param.getLink(), e.getMessage(), 2, code);
|
|
param.getCompanyUserId(), param.getLink(), e.getMessage(), 2, code);
|
|
|
return null;
|
|
return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // code == null,SDK/网络层临时异常,换账号重试
|
|
|
|
|
+ log.warn("个人账号[{}]临时异常,切换下一个: {}", account.getAppId(), e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -205,10 +209,14 @@ public class FeiShuService {
|
|
|
log.warn("公共账号被禁用,尝试下一个");
|
|
log.warn("公共账号被禁用,尝试下一个");
|
|
|
} else if (code != null && (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code))) {
|
|
} else if (code != null && (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code))) {
|
|
|
log.warn("公共账号可重试错误,切换下一个");
|
|
log.warn("公共账号可重试错误,切换下一个");
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else if (code != null) {
|
|
|
|
|
+ // 明确的业务错误码,终止
|
|
|
recordLinkError(param.getVideoId(), param.getCompanyId(), param.getCourseId(),
|
|
recordLinkError(param.getVideoId(), param.getCompanyId(), param.getCourseId(),
|
|
|
param.getCompanyUserId(), param.getLink(), e.getMessage(), 2, code);
|
|
param.getCompanyUserId(), param.getLink(), e.getMessage(), 2, code);
|
|
|
return null;
|
|
return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // code == null,SDK/网络层临时异常,换账号重试
|
|
|
|
|
+ log.warn("公共账号临时异常,切换下一个: {}", e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -263,10 +271,14 @@ public class FeiShuService {
|
|
|
log.warn("个人账号[{}]被禁用,尝试下一个", account.getAppId());
|
|
log.warn("个人账号[{}]被禁用,尝试下一个", account.getAppId());
|
|
|
} else if (code != null && (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code))) {
|
|
} else if (code != null && (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code))) {
|
|
|
log.warn("个人账号[{}]可重试错误,切换下一个", account.getAppId());
|
|
log.warn("个人账号[{}]可重试错误,切换下一个", account.getAppId());
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else if (code != null) {
|
|
|
|
|
+ // 明确的业务错误码,终止
|
|
|
recordLinkError(param.getVideoId(), param.getCompanyId(), param.getCourseId(),
|
|
recordLinkError(param.getVideoId(), param.getCompanyId(), param.getCourseId(),
|
|
|
param.getCompanyUserId(), param.getLink(), e.getMessage(), 2, code);
|
|
param.getCompanyUserId(), param.getLink(), e.getMessage(), 2, code);
|
|
|
throw new CustomException(e.getMessage());
|
|
throw new CustomException(e.getMessage());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // code == null,SDK/网络层临时异常,换账号重试
|
|
|
|
|
+ log.warn("个人账号[{}]临时异常,切换下一个: {}", account.getAppId(), e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -295,10 +307,14 @@ public class FeiShuService {
|
|
|
log.warn("公共账号被禁用,尝试下一个");
|
|
log.warn("公共账号被禁用,尝试下一个");
|
|
|
} else if (code != null && (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code))) {
|
|
} else if (code != null && (FeishuErrorCode.isRateLimit(code) || FeishuErrorCode.isInternalRetryable(code))) {
|
|
|
log.warn("公共账号可重试错误,切换下一个");
|
|
log.warn("公共账号可重试错误,切换下一个");
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else if (code != null) {
|
|
|
|
|
+ // 明确的业务错误码,终止
|
|
|
recordLinkError(param.getVideoId(), param.getCompanyId(), param.getCourseId(),
|
|
recordLinkError(param.getVideoId(), param.getCompanyId(), param.getCourseId(),
|
|
|
param.getCompanyUserId(), param.getLink(), e.getMessage(), 2, code);
|
|
param.getCompanyUserId(), param.getLink(), e.getMessage(), 2, code);
|
|
|
throw new CustomException(e.getMessage());
|
|
throw new CustomException(e.getMessage());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // code == null,SDK/网络层临时异常,换账号重试
|
|
|
|
|
+ log.warn("公共账号临时异常,切换下一个: {}", e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|