From 2252135fadb8c579ad27345e3203be755130e3cd Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 20 Jun 2022 15:20:18 +0200 Subject: 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 --- cmd/cli/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd/cli') 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 } -- cgit v1.2.3