Skip to content

Conversation

@childish-sambino
Copy link
Contributor

Fixes #1068

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Mar 30, 2020
//Default headers
this.defaultHeaders = {
'Accept': 'application/json',
Accept: 'application/json',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we convert to a non-string key here? Why only for the Accept key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quotes aren't needed here and is an eslint warning.

this.apiKey = apiKey;

if (!this.isValidApiKey(apiKey)) {
console.warn(`API key does not start with ${API_KEY_PREFIX}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a spot to put the message: https://github.com/sendgrid/sendgrid-nodejs/blob/master/packages/helpers/constants/index.js -- nit: period at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's in the helpers package. I don't like defining the message in 1 package and using it in another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: code review request requesting a community code review or review from Twilio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error handling in setApiKey

2 participants