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

Stop adding statusCode #30

Merged
merged 1 commit into from
Mar 10, 2020
Merged

Stop adding statusCode #30

merged 1 commit into from
Mar 10, 2020

Conversation

GaryGSC
Copy link
Member

@GaryGSC GaryGSC commented Dec 17, 2019

As a result of L141 and L152 in ec73fd4,
I now get bodies that have a statusCode property that I wasn't expecting, like:

{
  "metadata": {
    "validation_response": {
      "code": 404,
      "message": "Not Found"
    }
  },
  "statusCode": 500
}

The preferred way to get the statusCode is to use the resolveWithFullResponse option.

As a result of L141 and L152 in ec73fd4, I now get bodies that have a statusCode property that I wasn't expecting, like:
```
{
  "metadata": {
    "validation_response": {
      "code": 404,
      "message": "Not Found"
    }
  },
  "statusCode": 500
}
```

The preferred way to get the statusCode is to use the [`resolveWithFullResponse` option](https://www.npmjs.com/package/request-promise#get-the-full-response-instead-of-just-the-body).
@GaryGSC
Copy link
Member Author

GaryGSC commented Dec 17, 2019

Also, see the 4th example of a request in this package's README.

@GaryGSC
Copy link
Member Author

GaryGSC commented Dec 17, 2019

Also getting these errors now:

TypeError: Cannot create property 'statusCode' on string '<ams:fault xmlns:ams="http://wso2.org/apimanager/security"><ams:code>900901</ams:code><ams:message>Invalid Credentials</ams:message><ams:description>Access failure for API: SOME_API, version: v1 with key: REDACTED. Make sure your have given the correct access token</ams:description></ams:fault>'

This was referenced Mar 10, 2020
@GaryGSC
Copy link
Member Author

GaryGSC commented Mar 10, 2020

This is causing INC0456212.

@GaryGSC GaryGSC merged commit 40cae34 into master Mar 10, 2020
@GaryGSC GaryGSC deleted the statusCode branch March 10, 2020 21:35
GaryGSC added a commit that referenced this pull request Mar 11, 2020
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.

1 participant