summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/packages/packages.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/packages/packages.go b/services/packages/packages.go
index 64b1ddd869..8f688a74f4 100644
--- a/services/packages/packages.go
+++ b/services/packages/packages.go
@@ -165,11 +165,15 @@ func createPackageAndVersion(ctx context.Context, pvci *PackageCreationInfo, all
if pv, err = packages_model.GetOrInsertVersion(ctx, pv); err != nil {
if err == packages_model.ErrDuplicatePackageVersion {
versionCreated = false
- }
- if err != packages_model.ErrDuplicatePackageVersion || !allowDuplicate {
+ } else {
log.Error("Error inserting package: %v", err)
return nil, false, err
}
+
+ if !allowDuplicate {
+ // no need to log an error
+ return nil, false, err
+ }
}
if versionCreated {