keys.js potential for uncaught exception
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes it appears that the aws-sdk can return no error object, and also provide a data object where .Contents is undefined. In that case we would throw an unhandled error in the callback when we try and .slice the anticipated array.
s3.listObjects(params, function(err, data) {
assert.notOk(err, 'there is no error');
assert.notOk(data.Contents, 'there is also no information');
});
cc @yhahn
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at lib/keys.js line 53 and inspect the callback handling when the AWS response has no error but lacks data.Contents. Add coverage for the shown callback scenario and verify that it no longer produces an unhandled exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript, node.js
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100