diff options
Diffstat (limited to 'i18n/translationProvider.go')
-rw-r--r-- | i18n/translationProvider.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/i18n/translationProvider.go b/i18n/translationProvider.go index 5f90895aa..4e937c5a1 100644 --- a/i18n/translationProvider.go +++ b/i18n/translationProvider.go @@ -15,14 +15,13 @@ package i18n import ( "errors" - "fmt" - - "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/deps" + "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/source" "github.com/nicksnyder/go-i18n/i18n/bundle" "github.com/nicksnyder/go-i18n/i18n/language" + _errors "github.com/pkg/errors" ) // TranslationProvider provides translation handling, i.e. loading @@ -82,12 +81,12 @@ func (tp *TranslationProvider) Update(d *deps.Deps) error { func addTranslationFile(bundle *bundle.Bundle, r source.ReadableFile) error { f, err := r.Open() if err != nil { - return fmt.Errorf("Failed to open translations file %q: %s", r.LogicalName(), err) + return _errors.Wrapf(err, "Failed to open translations file %q:", r.LogicalName()) } defer f.Close() err = bundle.ParseTranslationFileBytes(r.LogicalName(), helpers.ReaderToBytes(f)) if err != nil { - return fmt.Errorf("Failed to load translations in file %q: %s", r.LogicalName(), err) + return _errors.Wrapf(err, "Failed to load translations in file %q:", r.LogicalName()) } return nil } |