aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-11-27 13:19:06 +0900
committerOphestra <cat@gensokyo.uk>2026-11-27 13:19:06 +0900
commit2e2ef6a602910f905e850812c4f8da6db0b78121 (patch)
tree82bbe64ce06292badff1117ff08c01ae7bbe9211
parent6ac505ba631475a1f060ea9cb34f3d01de918b89 (diff)
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 <cat@gensokyo.uk>
-rw-r--r--pkg/pkg.go10
1 files changed, 5 insertions, 5 deletions
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)