Skip to content

Commit

Permalink
feat(CLI): On pull error, print the API response (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
jablan authored Nov 3, 2023
1 parent ec6cc1e commit b0b6ed1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clients/cli/cmd/internal/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit b0b6ed1

Please sign in to comment.