summaryrefslogtreecommitdiffstats
path: root/helpers/path.go
diff options
context:
space:
mode:
authorCameron Moore <moorereason@gmail.com>2016-12-22 22:44:35 -0600
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-12-23 19:48:50 +0100
commit8b0c3b9b271c7f3eaa812f7a98bb738fe9cc1846 (patch)
tree11008896434e44065b431886bbc12f67fb051b51 /helpers/path.go
parent34c87421b82b967a8ae85261ca9a3e9fe7b156da (diff)
helpers: Remove "no theme set" warning
Fixes #2821
Diffstat (limited to 'helpers/path.go')
-rw-r--r--helpers/path.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/helpers/path.go b/helpers/path.go
index 7dea0b0dd..6e2422d05 100644
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -31,6 +31,13 @@ import (
"golang.org/x/text/unicode/norm"
)
+var (
+ // ErrThemeUndefined is returned when a theme has not be defined by the user.
+ ErrThemeUndefined = errors.New("no theme set")
+
+ ErrWalkRootTooShort = errors.New("Path too short. Stop walking.")
+)
+
// filepathPathBridge is a bridge for common functionality in filepath vs path
type filepathPathBridge interface {
Base(in string) string
@@ -207,7 +214,7 @@ func GetThemeI18nDirPath() (string, error) {
func getThemeDirPath(path string) (string, error) {
if !ThemeSet() {
- return "", errors.New("No theme set")
+ return "", ErrThemeUndefined
}
themeDir := filepath.Join(GetThemeDir(), path)
@@ -485,8 +492,6 @@ func FindCWD() (string, error) {
return path, nil
}
-var ErrWalkRootTooShort = errors.New("Path too short. Stop walking.")
-
// SymbolicWalk is like filepath.Walk, but it supports the root being a
// symbolic link. It will still not follow symbolic links deeper down in
// the file structure