refactor(*): 稳定期治理 - 收敛核心架构、错误语义并修复跨项目数据竞态
This commit is contained in:
1 parent
bacd502f5c
commit
b5f3413ded
298 files changed
+12681
-26428
No files matched your search
@@ -25,7 +25,14 @@ func TestAppErrorPreservesSafeProjectionAndCause(t *testing.T) {
|
||||
func TestAuthErrorAliasRemainsCompatible(t *testing.T) {
|
||||
var err *AuthError = BadAuthRequest("请求参数错误")
|
||||
var appErr *AppError
|
||||
if !errors.As(err, &appErr) || appErr.Status != 400 || appErr.Message != "请求参数错误" {
|
||||
if !errors.As(err, &appErr) || appErr.Status != 400 || appErr.Code != 400 || appErr.Reason != ReasonInvalidArgument || appErr.Message != "请求参数错误" {
|
||||
t.Fatalf("AuthError compatibility = %#v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestQuotaExceededUsesStableCodeAndReason(t *testing.T) {
|
||||
err := QuotaExceeded("账号素材数量已达到 1 个上限")
|
||||
if err.Status != 403 || err.Code != CodeQuotaExceeded || err.Reason != ReasonQuotaExceeded {
|
||||
t.Fatalf("QuotaExceeded = %#v", err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user