Closed alexkli closed 4 years ago
Merging #196 into master will increase coverage by
<.01%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #196 +/- ##
==========================================
+ Coverage 99.27% 99.27% +<.01%
==========================================
Files 14 14
Lines 411 414 +3
==========================================
+ Hits 408 411 +3
Misses 3 3
Impacted Files | Coverage Δ | |
---|---|---|
lib/client.js | 98.88% <100%> (+0.03%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 216c65e...b270307. Read the comment docs.
When a network or internal exception is thrown when making the http request via
needle
(for example when mocking via unit tests using nock), it would throw aTypeError
inClient.handleErrors()
becausereason.options
is not set for those error (reason is the caught error object):This PR fixes it by adding the necessary structure upon errors inside
rp()
.Included a unit test that uncovers the problem: https://github.com/apache/openwhisk-client-js/pull/196/files#diff-1a5d07059384adab4362f4ed2eed98e2R26