From 2e2ef6a602910f905e850812c4f8da6db0b78121 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 27 Nov 2026 13:19:06 +0900 Subject: pkg: do not dispatch fault on collection The special Collected error is not a fault, and serves only to indicate collection success. This change dispatches it as NExit. Signed-off-by: Ophestra --- pkg/pkg.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/pkg.go') diff --git a/pkg/pkg.go b/pkg/pkg.go index 07d467c7..2d102666 100644 --- a/pkg/pkg.go +++ b/pkg/pkg.go @@ -1821,9 +1821,9 @@ func (c *Cache) enterCure(a Artifact, curesExempt bool) error { } // exitCure must be called after exiting an [Artifact] implementation. -func (c *Cache) exitCure(a Artifact, curesExempt, ok bool) { +func (c *Cache) exitCure(a Artifact, curesExempt bool, err error) { if c.attr.Notify != nil { - if ok { + if err == nil || IsCollected(err) { c.attr.Notify <- NExit } else { c.attr.Notify <- NFault @@ -2295,7 +2295,7 @@ func (c *Cache) cure(a Artifact, curesExempt, rebuild bool) ( err = closeErr } } - c.exitCure(a, curesExempt, err == nil) + c.exitCure(a, curesExempt, err) if err != nil { if c.msg.IsVerbose() { c.msg.Verbosef( @@ -2346,7 +2346,7 @@ func (c *Cache) cure(a Artifact, curesExempt, rebuild bool) ( return } err = ca.Cure(&t) - c.exitCure(a, curesExempt, err == nil) + c.exitCure(a, curesExempt, err) if err != nil { if c.msg.IsVerbose() { c.msg.Verbosef( @@ -2518,7 +2518,7 @@ func (c *Cache) cure(a Artifact, curesExempt, rebuild bool) ( return } err = ca.Cure(&f) - c.exitCure(a, curesExempt, err == nil) + c.exitCure(a, curesExempt, err) if !rebuild && err == nil { err = f.linkSubstitute(ids, substitutes) -- cgit v1.3.1