Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: using common.Invalid instead of common.DbMissingWhereClause if it is a logic error (#2686)

h3n4l4d2c6edf2b57
diff --git a/common/error.go b/common/error.go
index 288b1138e5..41017f4576 100644
--- a/common/error.go
+++ b/common/error.go
@@ -21,9 +21,8 @@ const (
NotImplemented Code = 6
// 101 ~ 199 db error.
- DbConnectionFailure Code = 101
- DbExecutionError Code = 102
- DbMissingWhereClause Code = 103
+ DbConnectionFailure Code = 101
+ DbExecutionError Code = 102
// 201 db migration error
// Db migration is a core feature, so we separate it from the db error.
diff --git a/store/repository.go b/store/repository.go
index 189a0b784b..b53f6b6898 100644
--- a/store/repository.go
+++ b/store/repository.go
@@ -576,7 +576,7 @@ func patchRepositoryImpl(ctx context.Context, tx *Tx, patch *api.RepositoryPatch
where, args = append(where, fmt.Sprintf("web_url = $%d", len(args)+1)), append(args, *v)
}
if len(where) == 0 {
- return nil, common.Errorf(common.DbMissingWhereClause, "missing where clause for patching repository")
+ return nil, common.Errorf(common.Invalid, "missing predicate in where clause for patching repository")
}
var repository repositoryRaw