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

Update json-api-client and client error handler #4

Merged
merged 4 commits into from
Oct 2, 2015
Merged

Update json-api-client and client error handler #4

merged 4 commits into from
Oct 2, 2015

Conversation

chrissnyder
Copy link

No description provided.

("#{key} #{error}" for key, error of message).join '\n'
errorMessage = errorMessage.join '\n'
apiClient.handleError = (error) ->
responseText = try JSON.parse error.text
Copy link
Owner

Choose a reason for hiding this comment

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

I think superagent returns parsed json right?

Copy link
Author

Choose a reason for hiding this comment

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

It does, in error.body. Can swap to that, just kept changes to a minimum.

Copy link
Owner

Choose a reason for hiding this comment

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

Cool let's do that, no reason to Parse JSON twice.

edpaget added a commit that referenced this pull request Oct 2, 2015
Update json-api-client and client error handler
@edpaget edpaget merged commit 44ea18c into edpaget:superagent Oct 2, 2015
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.

2 participants