zendesk / zcli

A command-line tool for Zendesk
https://developer.zendesk.com
Apache License 2.0
63 stars 21 forks source link

Helpful error messages if authentication fails #57

Open joelhellman opened 3 years ago

joelhellman commented 3 years ago

Expectations

I ran two commands that failed with two different outputs, but neither message indicated the root cause of authentication failure.

I expect that if I run a command that tries to authenticate to a Zendesk account, and the authenticate fails, the error messages should indicate that.

Reality

$ zcli apps:create
Uploading app... Failed
 ›   Error: Failed to upload app myapp
$ zcli apps:validate
 ›   Error: FetchError: invalid json response body at https://myapp.zendesk.com/api/v2/apps/validate reason: Unexpected token R in JSON at position 0

Steps to Reproduce

  1. set env vars ZENDESK_SUBDOMAIN, ZENDESK_EMAIL, ZENDESK_API_TOKEN
  2. have the ZENDESK_API_TOKEN be a value that results in failure to authenticate
  3. try different zcli commands relying on authentication - does the error message indicates is an authentication failure?

Issue details

eric-at-nocoast commented 3 years ago

Hey Joel,

Just following up to let you know I've seen this and will be logging this as an enhancement.