Skip to content

Response data should be valid json objects #266

@mrfelton

Description

@mrfelton

Issue Summary

Currently, the data that you get from SendgridError.response is a stringified json. That means in order to inspect it you have to parse it with JSON.parse. Thats a pain in the ass to do. The same is true of the response body for successful calls. This leads to code like const response = JSON.parse(response.body) everywhere in order to actually use the result of API calls or const body = JSON.parse(err.response.body) in order to get the details from any errors.

I think it would make sense to parse this data in the library so that users of the library don't have to.

  • sendgrid-nodejs Version: master
  • Node.js Version: 4.1.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions