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 more context to product error message #77

Open
lojzatran opened this issue May 19, 2016 · 1 comment
Open

Add more context to product error message #77

lojzatran opened this issue May 19, 2016 · 1 comment

Comments

@lojzatran
Copy link
Contributor

lojzatran commented May 19, 2016

When there's an error in the price import, it does not provide enough information to identify on which product the error occurred. A product ID would be good to see with the error.

Example error message from LogEntries:

» 19 May 2016 08:06:01.390 { "v": 0, "id": "18077b886be8", "image": "sphereio/xxx-cli:production", "name": "xxx-cli", "line": { "name": "xxx-cli-0.0.1", "hostname": "xxx-prod-jolly-ramanujan.frontend.prod.commercetools.de", "pid": 1, "widget_type": "price", "level": 50, "err": { "message": "Duplicate price scope: (currency: EUR, country: AT, validFrom: 2016-05-19T00:00:00.000Z, validUntil: 2016-05-19T23:59:59.000Z). The combination of currency, country, customerGroup and channel must be unique for each price of a product variant.", "name": "BadRequest", "stack": "BadRequest: Duplicate price scope: (currency: EUR, country: AT, validFrom: 2016-05-19T00:00:00.000Z, validUntil: 2016-05-19T23:59:59.000Z). The combination of currency, country, customerGroup and channel must be unique for each price of a product variant.\n at /app/node_modules/sphere-product-import/node_modules/sphere-node-sdk/lib/services/base.js:448:22\n at ProductService.BaseService._wrapResponse (/app/node_modules/sphere-product-import/node_modules/sphere-node-sdk/lib/services/base.js:463:11)\n at /app/node_modules/sphere-product-import/node_modules/sphere-node-sdk/lib/services/base.js:353:40\n at Request._callback (/app/node_modules/sphere-product-import/node_modules/sphere-node-sdk/lib/connect/rest.js:159:14)\n at Request.self.callback (/app/node_modules/sphere-product-import/node_modules/sphere-node-sdk/node_modules/request/request.js:360:22)\n at emitTwo (events.js:87:13)\n at Request.emit (events.js:172:7)\n at Request.<anonymous> (/app/node_modules/sphere-product-import/node_modules/sphere-node-sdk/node_modules/request/request.js:1202:14)\n at emitOne (events.js:82:20)\n at Request.emit (events.js:169:7)\n at IncomingMessage.<anonymous> (/app/node_modules/sphere-product-import/node_modules/sphere-node-sdk/node_modules/request/request.js:1150:12)\n at emitNone (events.js:72:20)\n at IncomingMessage.emit (events.js:166:7)\n at endReadableNT (_stream_readable.js:913:12)\n at nextTickCallbackWith2Args (node.js:442:9)\n at process._tickCallback (node.js:356:17)", "code": 400 }, "msg": "Skipping product due to error message: Duplicate price scope: (currency: EUR, country: AT, validFrom: 2016-05-19T00:00:00.000Z, validUntil: 2016-05-19T23:59:59.000Z). The combination of currency, country, customerGroup and channel must be unique for each price of a product variant.", "time": "2016-05-19T06:06:00.528Z", "v": 0 }, "host": "xxx-prod-jolly-ramanujan.frontend.prod.commercetools.de" } xxx-CLIPrice Context

@pgbytes
Copy link
Contributor

pgbytes commented May 24, 2016

For this u can do two things

  • parse the product of from the error body and add it to the message before logging it. Or log the complete error body.
  • make a request for this in the CTP API. Since this is the exception coming from the API

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

4 participants