replace tozd/errors with Southclaws/fault
1 file changed, 7 insertions(+), 6 deletions(-)
changed files
M internal/storage/file.go → internal/storage/file.go
@@ -5,7 +5,8 @@ "io" "strings" "time" - "gitlab.com/tozd/go/errors" + "github.com/Southclaws/fault" + "github.com/Southclaws/fault/fmsg" "go.alanpearce.eu/homestead/internal/buffer" "go.alanpearce.eu/homestead/internal/builder/template" )@@ -29,14 +30,14 @@ return encs } -func (f *File) CalculateStyleHash() (err errors.E) { +func (f *File) CalculateStyleHash() (err error) { buf := f.Encodings["identity"] if buf == nil { - return errors.New("buffer not initialised") + return fault.New("buffer not initialised") } if _, err := buf.Seek(0, io.SeekStart); err != nil { - return errors.WithMessage(err, "could not seek buffer") + return fault.Wrap(err, fmsg.With("could not seek buffer")) } mime, _, _ := strings.Cut(f.ContentType, ";")@@ -44,13 +45,13 @@ switch mime { case "text/html": f.StyleHash, err = template.GetHTMLStyleHash(buf) if err != nil { - return errors.WithMessage(err, "could not calculate HTML style hash") + return fault.Wrap(err, fmsg.With("could not calculate HTML style hash")) } default: return } if _, err := buf.Seek(0, io.SeekStart); err != nil { - return errors.WithMessage(err, "could not seek buffer") + return fault.Wrap(err, fmsg.With("could not seek buffer")) } return