Skip to content

Commit b0b6ed1

Browse files
authored
feat(CLI): On pull error, print the API response (#463)
1 parent ec6cc1e commit b0b6ed1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clients/cli/cmd/internal/pull.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ func (target *Target) Pull(client *phrase.APIClient, branch string) error {
120120

121121
err = target.DownloadAndWriteToFile(client, localeFile, branch)
122122
if err != nil {
123+
if openapiError, ok := err.(phrase.GenericOpenAPIError); ok {
124+
print.Warn("API response: %s", openapiError.Body())
125+
}
123126
return fmt.Errorf("%s for %s", err, localeFile.Path)
124127
} else {
125128
print.Success("Downloaded %s to %s", localeFile.Message(), localeFile.RelPath())

0 commit comments

Comments
 (0)