summaryrefslogtreecommitdiff
path: root/cmd/cli/main.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-06-20 15:20:18 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-06-20 15:20:18 +0200
commit2252135fadb8c579ad27345e3203be755130e3cd (patch)
treeed5a530e85b43736fc0bc28c927cfa8488f9199b /cmd/cli/main.go
parent7af07c596166bf93b79a9d0816b1950dde360fb9 (diff)
Refactor: Errors to have one custom type that is to be wrapped
- For this an `internal/types` package is created with a custom error type - This custom error type can give back the cause and traceback of an error
Diffstat (limited to 'cmd/cli/main.go')
-rw-r--r--cmd/cli/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/cli/main.go b/cmd/cli/main.go
index a9bff2e..e6be0bf 100644
--- a/cmd/cli/main.go
+++ b/cmd/cli/main.go
@@ -205,7 +205,9 @@ func printConfig(url string, isInstitute bool) {
config, _, configErr := getConfig(state, url, isInstitute)
if configErr != nil {
- fmt.Println("Error getting config", configErr)
+ // Show the usage of tracebacks and causes
+ fmt.Println("Error getting config:", state.GetErrorTraceback(configErr))
+ fmt.Println("Error getting config, cause:", state.GetErrorCause(configErr))
return
}