diff options
Diffstat (limited to 'helpers/pathspec.go')
-rw-r--r-- | helpers/pathspec.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/helpers/pathspec.go b/helpers/pathspec.go index de7665c87..ff4488020 100644 --- a/helpers/pathspec.go +++ b/helpers/pathspec.go @@ -60,10 +60,14 @@ func (p PathSpec) String() string { } // NewPathSpec creats a new PathSpec from the given filesystems and Language. -func NewPathSpec(fs *hugofs.Fs, cfg config.Provider) *PathSpec { +func NewPathSpec(fs *hugofs.Fs, cfg config.Provider) (*PathSpec, error) { - // TODO(bep) output error handling - baseURL, _ := newBaseURLFromString(cfg.GetString("baseURL")) + baseURLstr := cfg.GetString("baseURL") + baseURL, err := newBaseURLFromString(baseURLstr) + + if err != nil { + return nil, fmt.Errorf("Failed to create baseURL from %q: %s", baseURLstr, err) + } ps := &PathSpec{ fs: fs, @@ -87,7 +91,7 @@ func NewPathSpec(fs *hugofs.Fs, cfg config.Provider) *PathSpec { ps.language = language } - return ps + return ps, nil } // PaginatePath returns the configured root path used for paginator pages. |