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

Add a status code to the error message #47

Merged
merged 1 commit into from
Jun 22, 2017
Merged

Add a status code to the error message #47

merged 1 commit into from
Jun 22, 2017

Conversation

kairome
Copy link
Contributor

@kairome kairome commented Jun 22, 2017

Abstract

createError(err) function was omitting status code in creating the error object, and as the result koa-onerror library was getting no status code. As can be seen here, in such a case koa will put status 500 automatically.

Issue

In this issue, when no product could be found, storefront's server responded with 500, which is unexpected.
This addition of error.status fixes the issue, now the server response has the correct status code
error - 404 - google chrome_002

Verified

This commit was signed with the committer’s verified signature.
Aaron1011 Aaron Hill
@anru
Copy link
Contributor

anru commented Jun 22, 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

Successfully merging this pull request may close these issues.

None yet

2 participants