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

Commit 9db6820

Browse files
authored
Place uploader in try/rescue block and add pass_ci_if_error flag (#137)
1 parent 693e6fb commit 9db6820

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### `0.5.0`
2+
- #137 Place uploader in try/rescue block and add pass_ci_if_error flag
3+
14
### `0.4.3`
25
- #135 Shorten coverage message on formatter
36

lib/codecov/uploader.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ def self.upload(report, disable_net_blockers = true)
3737

3838
display_header
3939
ci = detect_ci
40-
response = upload_to_codecov(ci, report)
40+
41+
begin
42+
response = upload_to_codecov(ci, report)
43+
rescue StandardError => e
44+
puts `#{e.message}`
45+
puts `#{e.backtrace.join("\n")}`
46+
raise e unless ::SimpleCov.pass_ci_if_error
47+
48+
response = false
49+
end
50+
4151
if response == false
4252
report['result'] = { 'uploaded' => false }
4353
return report

lib/codecov/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Codecov
4-
VERSION = '0.4.3'
4+
VERSION = '0.5.0'
55
end

0 commit comments

Comments
 (0)