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
Fix handling of numeric error codes coming from AWS SDK requests #9538
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9538 +/- ##
=======================================
Coverage 86.70% 86.70%
=======================================
Files 321 321
Lines 12072 12075 +3
=======================================
+ Hits 10467 10470 +3
Misses 1605 1605
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great call, just a minor stylistic comment.
test/unit/lib/aws/request.test.js
Outdated
@@ -246,7 +271,10 @@ describe('#request', () => { | |||
const awsRequest = proxyquire('../../../../lib/aws/request', { | |||
'aws-sdk': { S3: FakeS3 }, | |||
}); | |||
return expect(awsRequest({ name: 'S3' }, 'error')).to.be.rejected; | |||
return expect(awsRequest({ name: 'S3' }, 'test')).to.eventually.be.rejected.and.have.property( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is return needed here? should it
be marked as async and awaited?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it's needed if we do not await
(and effect is same), but I agree that it's better to mark all promise returning functions as async, and to use await
when we do not intend to return anything substantial.
I've updated those tests
Closes: #9511