all repos — searchix @ 9015baf955c94a806c01b3dcd5648c8e68ad2685

Search engine for NixOS, nix-darwin, home-manager and NUR users

refactor: ensure errors have stack traces

Alan Pearce
commit

9015baf955c94a806c01b3dcd5648c8e68ad2685

parent

7bb77ff5729cc9434afee895a470fd3b4c12e6d1

1 file changed, 4 insertions(+), 3 deletions(-)

changed files
M internal/importer/importer.gointernal/importer/importer.go
@@ -4,13 +4,14 @@ import (
"context" "sync" + "gitlab.com/tozd/go/errors" "go.alanpearce.eu/searchix/internal/index" "go.alanpearce.eu/searchix/internal/nix" "go.alanpearce.eu/x/log" ) type Processor interface { - Process(context.Context) (<-chan nix.Importable, <-chan error) + Process(context.Context) (<-chan nix.Importable, <-chan errors.E) } func process(
@@ -18,7 +19,7 @@ ctx context.Context,
indexer *index.WriteIndex, processor Processor, logger *log.Logger, -) (bool, error) { +) (bool, errors.E) { wg := sync.WaitGroup{} wg.Add(1)
@@ -28,7 +29,7 @@ wg.Add(1)
iErrs := indexer.Import(ctx, objects) var hadObjectErrors bool - var criticalError error + var criticalError errors.E go func() { for { select {