about summary refs log tree commit diff stats
path: root/internal/config
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go4
-rw-r--r--internal/config/fetcher.go3
-rw-r--r--internal/config/repository.go6
3 files changed, 8 insertions, 5 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index b2af53c..2822d0c 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -7,7 +7,7 @@ import (
 	"time"
 
 	"github.com/pelletier/go-toml/v2"
-	"github.com/pkg/errors"
+	"gitlab.com/tozd/go/errors"
 	"go.alanpearce.eu/x/log"
 )
 
@@ -103,7 +103,7 @@ func mustLocalTime(in string) (time LocalTime) {
 	return
 }
 
-func GetConfig(filename string, log *log.Logger) (*Config, error) {
+func GetConfig(filename string, log *log.Logger) (*Config, errors.E) {
 	config := DefaultConfig
 	if filename != "" {
 		log.Debug("reading config", "filename", filename)
diff --git a/internal/config/fetcher.go b/internal/config/fetcher.go
index fd95b32..fca6cb1 100644
--- a/internal/config/fetcher.go
+++ b/internal/config/fetcher.go
@@ -4,6 +4,7 @@ import (
 	"fmt"
 
 	"github.com/stoewer/go-strcase"
+	"gitlab.com/tozd/go/errors"
 )
 
 type Fetcher int
@@ -37,7 +38,7 @@ func ParseFetcher(name string) (Fetcher, error) {
 	case "download":
 		return Download, nil
 	default:
-		return UnknownFetcher, fmt.Errorf("unsupported fetcher %s", name)
+		return UnknownFetcher, errors.Errorf("unsupported fetcher %s", name)
 	}
 }
 
diff --git a/internal/config/repository.go b/internal/config/repository.go
index a074cbc..52b255e 100644
--- a/internal/config/repository.go
+++ b/internal/config/repository.go
@@ -3,6 +3,8 @@ package config
 import (
 	"fmt"
 	"strings"
+
+	"gitlab.com/tozd/go/errors"
 )
 
 type RepoType int
@@ -28,12 +30,12 @@ func (f RepoType) String() string {
 	}
 }
 
-func parseRepoType(name string) (RepoType, error) {
+func parseRepoType(name string) (RepoType, errors.E) {
 	switch strings.ToLower(name) {
 	case "github":
 		return GitHub, nil
 	default:
-		return UnknownRepoType, fmt.Errorf("unsupported repo type %s", name)
+		return UnknownRepoType, errors.Errorf("unsupported repo type %s", name)
 	}
 }