Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
check if response is falsy and if so, call the on_failure function wi…
Browse files Browse the repository at this point in the history
…th the error object instead of the response object
  • Loading branch information
dotnetCarpenter committed Aug 31, 2016
1 parent 3eb26c1 commit 925f194
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/codecov.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ var sendToCodecovV2 = function(codecov_endpoint, query, upload_body, on_success,
}, function(err, response, result){
if (err || response.statusCode !== 200) {
console.log(' ' + (err || response.body));
return on_failure(response.statusCode, response.body);
return response ? on_failure(response.statusCode, response.body) : on_failure(err.code, err.message);

} else {
console.log(' Success!');
Expand Down

0 comments on commit 925f194

Please sign in to comment.