commercetools / commercetools/sphere-node-cli

sphere-import doesn't exit with code 1 when it fails

Đang mở
#58 0 bình luận 0 reaction 1 người được giao Được @hisabimbola nhận Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
4
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Description
sphere-import -t order -p $SPHERE_PROJECT_KEY -f $jsonFile

### Expected Behavior
exit with code 1 (or any non-zero) as the order does not exist!

### Current Behavior
```json
info: {
"errors": [
{
"order": {
"orderNumber": "B-258-254-111",
"lineItems": [
{
"id": "da9e02c4-7937-49c6-afbb-6da2601e43dd",
"state": [
{
"quantity": 1,
"fromState": "exported",
"toState": "open"
}
]
}
]
},
"error": {
"code": "ENOENT",
"name": "Error",
"message": "Order with orderNumber B-258-254-111 not found.",
"stack": "Error: Order with orderNumber B-258-254-111 not found.\n at /usr/local/lib/node_modules/sphere-node-cli/node_modules/@commercetools/orders-update/dist/orders-update.js:166:45\n at tryCatcher (/usr/local/lib/node_modules/sphere-node-cli/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/sphere-node-cli/node_modules/bluebird/js/release/promise.js:510:31)\n at Promise._settlePromise (/usr/local/lib/node_modules/sphere-node-cli/node_modules/bluebird/js/release/promise.js:567:18)\n at Promise._settlePromise0 (/usr/local/lib/node_modules/sphere-node-cli/node_modules/bluebird/js/release/promise.js:612:10)\n at Promise._settlePromises (/usr/local/lib/node_modules/sphere-node-cli/node_modules/bluebird/js/release/promise.js:691:18)\n at Async._drainQueue (/usr/local/lib/node_modules/sphere-node-cli/node_modules/bluebird/js/release/async.js:133:16)\n at Async._drainQueues (/usr/local/lib/node_modules/sphere-node-cli/node_modules/bluebird/js/release/async.js:143:10)\n at Immediate.Async.drainQueues (/usr/local/lib/node_modules/sphere-node-cli/node_modules/bluebird/js/release/async.js:17:14)\n at runCallback (timers.js:649:20)\n at tryOnImmediate (timers.js:622:5)\n at processImmediate [as _immediateCallback] (timers.js:594:5)"
}
}
],
"inserted": [],
"successfullImports": 0
}
```
RETURN CODE: 0

### Context
There is no way to find if the command succeeded or failed!

### Possible Solution
The main module should exit with a non-zero code when a sub-module fails.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.