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

Commit

Permalink
Place uploader in try/rescue block and add pass_ci_if_error flag (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu authored Mar 1, 2021
1 parent 693e6fb commit 9db6820
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### `0.5.0`
- #137 Place uploader in try/rescue block and add pass_ci_if_error flag

### `0.4.3`
- #135 Shorten coverage message on formatter

Expand Down
12 changes: 11 additions & 1 deletion lib/codecov/uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@ def self.upload(report, disable_net_blockers = true)

display_header
ci = detect_ci
response = upload_to_codecov(ci, report)

begin
response = upload_to_codecov(ci, report)
rescue StandardError => e
puts `#{e.message}`
puts `#{e.backtrace.join("\n")}`
raise e unless ::SimpleCov.pass_ci_if_error

response = false
end

if response == false
report['result'] = { 'uploaded' => false }
return report
Expand Down
2 changes: 1 addition & 1 deletion lib/codecov/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Codecov
VERSION = '0.4.3'
VERSION = '0.5.0'
end

0 comments on commit 9db6820

Please sign in to comment.