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, 5 insertions(+), 5 deletions(-)

changed files
M frontend/assets.gofrontend/assets.go
@@ -8,7 +8,7 @@ "hash/fnv"
"io" "io/fs" - "github.com/pkg/errors" + "gitlab.com/tozd/go/errors" ) var Assets = &AssetCollection{
@@ -30,7 +30,7 @@ Stylesheets []*Asset
ByPath map[string]*Asset } -func newAsset(filename string) (*Asset, error) { +func newAsset(filename string) (*Asset, errors.E) { file, err := Files.Open(filename) if err != nil { return nil, errors.WithMessagef(err, "could not open file %s", filename)
@@ -51,7 +51,7 @@ Base64SHA256: base64.StdEncoding.EncodeToString(shasum.Sum(nil)),
}, nil } -func hashScripts() error { +func hashScripts() errors.E { scripts, err := fs.Glob(Files, "static/**.js") if err != nil { return errors.WithMessage(err, "could not glob files")
@@ -68,7 +68,7 @@
return nil } -func hashStyles() error { +func hashStyles() errors.E { styles, err := fs.Glob(Files, "static/**.css") if err != nil { return errors.WithMessage(err, "could not glob files")
@@ -85,7 +85,7 @@
return nil } -func Rehash() (err error) { +func Rehash() (err errors.E) { Assets.Scripts = []*Asset{} err = hashScripts() if err != nil {