refactor: ensure errors have stack traces
1 file changed, 4 insertions(+), 2 deletions(-)
changed files
M internal/config/repository.go → internal/config/repository.go
@@ -3,6 +3,8 @@ import ( "fmt" "strings" + + "gitlab.com/tozd/go/errors" ) type RepoType int@@ -28,12 +30,12 @@ return fmt.Sprintf("RepoType(%d)", f) } } -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) } }