refactor: update TargetDel

This commit is contained in:
ning 2025-07-27 12:46:22 +08:00
parent 143880cd46
commit 1bdfa3e032
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -60,6 +60,7 @@ _test
.vscode
.issue
.cursor
.claude
.DS_Store
.cache-loader
.payload

View File

@ -124,7 +124,7 @@ func TargetStatistics(ctx *ctx.Context) (*Statistics, error) {
func TargetDel(ctx *ctx.Context, idents []string, deleteHook TargetDeleteHookFunc) error {
if len(idents) == 0 {
panic("idents empty")
return errors.New("idents cannot be empty")
}
return DB(ctx).Transaction(func(tx *gorm.DB) error {