diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-06-20 15:20:18 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-06-20 15:20:18 +0200 |
| commit | 2252135fadb8c579ad27345e3203be755130e3cd (patch) | |
| tree | ed5a530e85b43736fc0bc28c927cfa8488f9199b /cmd | |
| parent | 7af07c596166bf93b79a9d0816b1950dde360fb9 (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')
| -rw-r--r-- | cmd/cli/main.go | 4 |
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 } |
