aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/testhelpers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/testhelpers_test.go')
-rw-r--r--hugolib/testhelpers_test.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go
index 6c1aa6fd0..4a72836af 100644
--- a/hugolib/testhelpers_test.go
+++ b/hugolib/testhelpers_test.go
@@ -28,10 +28,8 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/gohugoio/hugo/parser"
- "github.com/pkg/errors"
"github.com/fsnotify/fsnotify"
- "github.com/gohugoio/hugo/common/herrors"
"github.com/gohugoio/hugo/common/hexec"
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/config"
@@ -471,7 +469,6 @@ func (s *sitesBuilder) writeFilePairs(folder string, files []filenameContent) *s
func (s *sitesBuilder) CreateSites() *sitesBuilder {
if err := s.CreateSitesE(); err != nil {
- herrors.PrintStackTraceFromErr(err)
s.Fatalf("Failed to create sites: %s", err)
}
@@ -517,7 +514,7 @@ func (s *sitesBuilder) CreateSitesE() error {
"i18n",
} {
if err := os.MkdirAll(filepath.Join(s.workingDir, dir), 0777); err != nil {
- return errors.Wrapf(err, "failed to create %q", dir)
+ return fmt.Errorf("failed to create %q: %w", dir, err)
}
}
}
@@ -536,7 +533,7 @@ func (s *sitesBuilder) CreateSitesE() error {
}
if err := s.LoadConfig(); err != nil {
- return errors.Wrap(err, "failed to load config")
+ return fmt.Errorf("failed to load config: %w", err)
}
s.Fs.PublishDir = hugofs.NewCreateCountingFs(s.Fs.PublishDir)
@@ -549,7 +546,7 @@ func (s *sitesBuilder) CreateSitesE() error {
sites, err := NewHugoSites(depsCfg)
if err != nil {
- return errors.Wrap(err, "failed to create sites")
+ return fmt.Errorf("failed to create sites: %w", err)
}
s.H = sites
@@ -612,7 +609,6 @@ func (s *sitesBuilder) build(cfg BuildCfg, shouldFail bool) *sitesBuilder {
}
}
if err != nil && !shouldFail {
- herrors.PrintStackTraceFromErr(err)
s.Fatalf("Build failed: %s", err)
} else if err == nil && shouldFail {
s.Fatalf("Expected error")