Skip to content

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

fix: return 400 Bad Request if the backup setting violates the policy (#1940)

Yilong Lid135a86d4df5
diff --git a/server/database.go b/server/database.go
index f264845c87..3882bca050 100644
--- a/server/database.go
+++ b/server/database.go
@@ -569,6 +569,9 @@ func (s *Server) registerDatabaseRoutes(g *echo.Group) {
backupSetting, err := s.store.UpsertBackupSetting(ctx, backupSettingUpsert)
if err != nil {
+ if common.ErrorCode(err) == common.Invalid {
+ return echo.NewHTTPError(http.StatusBadRequest, "Invalid backup setting").SetInternal(err)
+ }
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to set backup setting").SetInternal(err)
}