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

Improves error objects #4

Merged
merged 2 commits into from Feb 1, 2017
Merged

Improves error objects #4

merged 2 commits into from Feb 1, 2017

Conversation

n-johnson
Copy link
Contributor

@n-johnson n-johnson commented Jan 30, 2017

Fixes #2

This updates the response handling code to ensure the response body is parsed as json before trying to use the request body in the error handling code.

Error before (currently on master):

{ WebflowError
    at /Users/nathan/webflow/node-webflow-api/dist/Webflow.js:95:37
    at process._tickCallback (internal/process/next_tick.js:103:7)
  _meta: { rateLimit: { limit: 60, remaining: 58 } },
  code: undefined,
  msg: undefined }

And after (as it is in this PR):

{ WebflowError: ValidationError: Validation Failure
    at /Users/nathan/webflow/node-webflow-api/dist/Webflow.js:70:17
    at process._tickCallback (internal/process/next_tick.js:103:7)
  code: 400,
  msg: 'Validation Failure',
  _meta: { rateLimit: { limit: 60, remaining: 58 } },
  problems: [ 'Field \'l\': Field not described in schema' ] }

Copy link
Contributor

@jacobwgillespie jacobwgillespie left a comment

Choose a reason for hiding this comment

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

LGTM!

@n-johnson n-johnson merged commit d846f01 into master Feb 1, 2017
@n-johnson n-johnson deleted the fix-error-msgs branch February 1, 2017 20:49
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.

None yet

2 participants