From afc3061c5179162c36264a99532a25151d53b326 Mon Sep 17 00:00:00 2001 From: Karem Abdul-Samad Date: Fri, 24 Jan 2025 10:59:47 -0500 Subject: [PATCH] Improve error reporting on config migration --- pkg/config/app_config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 381bbe076..5d240b87d 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -245,9 +245,11 @@ func migrateUserConfig(path string, content []byte) ([]byte, error) { // Write config back if changed if string(changedContent) != string(content) { + fmt.Println("Provided user config is deprecated but auto-fixable. Attempting to write fixed version back to file...") if err := os.WriteFile(path, changedContent, 0o644); err != nil { - return nil, fmt.Errorf("Couldn't write migrated config back to `%s`: %s", path, err) + return nil, fmt.Errorf("While attempting to write back fixed user config to %s, an error occurred: %s", path, err) } + fmt.Printf("Success. New config written to %s\n", path) return changedContent, nil }