cli
cli copied to clipboard
force:data:bulk:delete command return value=0 even on error
I'm using sfdx-cli/7.159.0 linux-x64 node-v16.15.1 and trying some bulk:deletes.
Noticed that even when the command fails -in my case it is failing because of API limits exceeded- the return value ($?)
is 0 (zero). Should not the return value ($?)
be 0 (zero) on success?
Outputs:
$ sfdx force:data:bulk:delete \
> --csvfile "$CSVFILE" \
> --sobjecttype "$SOBJECT" \
> --targetusername "$ORG_USER" \
> --wait 300
Bulk Delete... Error
ExceededQuota: ApiBatchItems Limit exceeded.
at BulkApi.getError (/home/yuri/.local/share/sfdx/client/7.159.0-f8fac41/node_modules/jsforce/lib/http-api.js:307:12)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /home/yuri/.local/share/sfdx/client/7.159.0-f8fac41/node_modules/jsforce/lib/http-api.js:154:23
at async /home/yuri/.local/share/sfdx/client/7.159.0-f8fac41/node_modules/jsforce/lib/api/bulk.js:428:21 {
errorCode: 'ExceededQuota',
content: undefined
}
$ echo "$?"
0
Thanks in advance.
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
This issue has been linked to a new work item: W-11509580
This is now in the latest CLIs: sfdx 7.208.10 / sf 1.85.8