We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ResponseError#response#body property has a type string assuming it is unparsed json string, but it is parsed json
ResponseError#response#body
string
import sendgrid from '@sendgrid/mail'; import config from '../config'; sendgrid.setApiKey(config.SENDGRID_API_KEY) sendgrid.send({ to: '[email protected]', from: '[email protected]', subject: 'Test Subject', text: 'body', attachments: [{ type: 'text', content: 'hello', filename: 'example.txt' }] }).catch((error) => { console.log(typeof error.response.body) })
object
Ideally, I would want body to be extensively typed like {body: {errors: {message: string, field: string, help?:string}[]}
body
{body: {errors: {message: string, field: string, help?:string}[]}
The text was updated successfully, but these errors were encountered:
Hello @bogdan,
Thanks for taking the time to report this!
I'm re-classifying this to a feature request since the current behavior is not broken, but it could be optimized.
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.
With best regards,
Elmer
Sorry, something went wrong.
Well, there is a feature component into that in the "Ideally" section, but there is also a bug that type definition is incorrect.
No branches or pull requests
Issue Summary
ResponseError#response#body
property has a typestring
assuming it is unparsed json string, but it is parsed jsonCode Snippet
Exception/Log
Ideally, I would want
body
to be extensively typed like{body: {errors: {message: string, field: string, help?:string}[]}
Technical details:
The text was updated successfully, but these errors were encountered: