Skip to content

Comments

feat(splitio-api-wrapper): implement httpGet function#3

Merged
celiawaggoner merged 4 commits intomasterfrom
splitioapi
Dec 11, 2019
Merged

feat(splitio-api-wrapper): implement httpGet function#3
celiawaggoner merged 4 commits intomasterfrom
splitioapi

Conversation

@celiawaggoner
Copy link
Contributor

No description provided.

try {
const response = await axios(requestOptions)
return response.data
} catch (e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In general i like the idea of catching the error and wrapping it so that the httpGet API doesn't leak details about it's implementation (e.g., using axios). on the other hand, i can imagine callers wanting more information about the failure (e.g., http code). so, we should either be prepared to add a bunch of metadata to the exception, or just let the axios one get thrown.

naming nit: e -> err

@celiawaggoner celiawaggoner merged commit 8945e17 into master Dec 11, 2019
@celiawaggoner celiawaggoner deleted the splitioapi branch December 11, 2019 16:31
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

Successfully merging this pull request may close these issues.

5 participants