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

Incorrect error handling response with resolveWithFullPromise #22

Open
tmwllc opened this issue Aug 25, 2017 · 0 comments
Open

Incorrect error handling response with resolveWithFullPromise #22

tmwllc opened this issue Aug 25, 2017 · 0 comments
Assignees

Comments

@tmwllc
Copy link
Contributor

tmwllc commented Aug 25, 2017

In src/middleware/request.js line 47 we pass in res.body as the third param to handleResponse function. But the third param in that function is err, so even on a valid response it sees the body as an error and will log it accordingly. Also, on line 19 we’re logging using err.toString(), but because err is actually an object in this case it will just output [object Object] when cast to string, so the resulting trace looks like this (irrelevant parts removed):

{
"operation": "PUT:/customerinformationservice/Customers/df40685f-3003-475a-b216-846a88ff739f/WebVerificationStatus/14E10B940C344963B3C7143B026A2139",
"tags": {
"http.method": "PUT",
"http.url": "https://sxgprod.nordstrom.net:443/customerinformationservice/Customers/df40685f-3003-475a-b216-846a88ff739f/WebVerificationStatus/14E10B940C344963B3C7143B026A2139",
"error": true,
"http.status_code": 200
},
"logs": [
{
"event": "error",
"error.object": "[object Object]"
}
]
}

Should switch this to JSON.stringify(err) instead. But should also fix issue which flags this response as an error anyway, as you can see that statusCode was 200 in this case.

steinbergkh added a commit that referenced this issue Aug 25, 2017
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

No branches or pull requests

2 participants