完善生图5.0的功能
This commit is contained in:
1 parent
88a4268d40
commit
678d213f40
31 files changed
+3281
-107
No files matched your search
@@ -458,10 +458,22 @@ func writeJobError(w http.ResponseWriter, err error, public bool) {
|
||||
message := "生成任务计费失败。"
|
||||
if public {
|
||||
message = "Generation job billing failed."
|
||||
} else if errors.Is(err, billing.ErrInsufficientBalance) {
|
||||
message = "余额不足,请先充值。"
|
||||
} else if errors.Is(err, billing.ErrOrganizationUnavailable) {
|
||||
message = "账号未绑定有效组织,请联系管理员。"
|
||||
}
|
||||
writeJSON(w, billingStatus.Status, map[string]string{"error": message})
|
||||
return
|
||||
}
|
||||
if errors.Is(err, billing.ErrProviderUnavailable) {
|
||||
message := "计费服务暂不可用,请稍后重试。"
|
||||
if public {
|
||||
message = "Generation billing is temporarily unavailable."
|
||||
}
|
||||
writeJSON(w, http.StatusServiceUnavailable, map[string]string{"error": message})
|
||||
return
|
||||
}
|
||||
writeJSON(w, 500, map[string]string{"error": "Internal server error."})
|
||||
}
|
||||
func randomJobID() string {
|
||||
|
||||
Reference in new issue
Block a user