Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors hidden #103

Open
psh-baxter opened this issue Aug 5, 2021 · 3 comments
Open

Errors hidden #103

psh-baxter opened this issue Aug 5, 2021 · 3 comments

Comments

@psh-baxter
Copy link

Currently in unmarshall it tries to read the error into an APIError struct but if it doesn't match the error text is lost forever.

It would be nice if

  1. The APIError struct matched the error json (I'm not sure if this applies to just some error responses or what)
  2. If deserialization fails there the raw body text is available to client libraries

Error json payloads are unlikely to be large so I don't think deserialization needs to happen directly from the body reader, it could be buffered entirely up front.

@psh-baxter
Copy link
Author

Here's an example 403 that wasn't deserializing:

{
  "error": {
    "title": "Forbidden",
    "message": "Unverified email address"
  }
}

@eggman64
Copy link
Member

eggman64 commented Aug 6, 2021

Thanks for reporting this and adding your suggestion. We will look into it

@eggman64
Copy link
Member

eggman64 commented Aug 9, 2021

@psh-baxter I looked into this and it appears that the APIError struct follows the API error response from Zendesk's API docs here.

Will dump the original response if we can't parse it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants