Skip to content

themes errors is not iterable #278

@bmodotdev

Description

@bmodotdev

Expectations

When a response body is empty, the error message should fallback to the HTTP status message.

Reality

Errors are hidden behind a type error when an empty response body is encountered.

Steps to Reproduce

Run a theme import with invalid credentials, which will trigger a 401 and empty response body:

ZENDESK_SUBDOMAIN=foo ZENDESK_EMAIL=user@example.com ZENDESK_API_TOKEN=hunter2 yarn dev themes:import --brandId=123 .
yarn run v1.22.22
$ ts-node ./packages/zcli/bin/run themes:import --brandId=123 .
Creating theme import job... !
TypeError: errors is not iterable
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Issue details

  • Command: yarn dev themes:import --brandId=123 .
  • Version: d0157ce
  • OS: Ubuntu 22.04.5 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions