From b0b6ed1b928f2c64fb618de76d88742e5f0cee8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mladen=20Jablanovi=C4=87?= Date: Fri, 3 Nov 2023 15:18:44 +0100 Subject: [PATCH] feat(CLI): On pull error, print the API response (#463) --- 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())