From 5cfda8ad6cdb7e1e0c73f970e5d50bac3eb7ec38 Mon Sep 17 00:00:00 2001 From: Mladen Jablanovic Date: Fri, 3 Nov 2023 13:49:10 +0100 Subject: [PATCH] feat(CLI): On pull error, print the API response --- clients/cli/cmd/internal/pull.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/cli/cmd/internal/pull.go b/clients/cli/cmd/internal/pull.go index b1f5a18c..9cbb36f1 100644 --- a/clients/cli/cmd/internal/pull.go +++ b/clients/cli/cmd/internal/pull.go @@ -120,6 +120,9 @@ func (target *Target) Pull(client *phrase.APIClient, branch string) error { err = target.DownloadAndWriteToFile(client, localeFile, branch) if err != nil { + if openapiError, ok := err.(phrase.GenericOpenAPIError); ok { + print.Warn("API response: %s", openapiError.Body()) + } return fmt.Errorf("%s for %s", err, localeFile.Path) } else { print.Success("Downloaded %s to %s", localeFile.Message(), localeFile.RelPath())