Skip to content

cart.js: No 'new' on util.error#4

Merged
ericingram merged 1 commit intoschemaio:masterfrom
amnotafraid:util-error
Apr 3, 2017
Merged

cart.js: No 'new' on util.error#4
ericingram merged 1 commit intoschemaio:masterfrom
amnotafraid:util-error

Conversation

@amnotafraid
Copy link
Contributor

If I have a bad product_id when I try to POST to /cart/add-item, I get error messages that start out like this:

TypeError: util.error is not a constructor
    at schema.get.then.product (/Users/razoyo-dev/apps2/schema-node-api/api/v1/cart.js:371:13)

This change fixes it, but do you want to do new Error(... rather than util.error(...?

@ericingram
Copy link
Contributor

Looks like it was an "error" to have used the new keyword here in the first place. Fix looks good, thank you!

@ericingram ericingram merged commit 94c135d into schemaio:master Apr 3, 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.

2 participants