Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit e70eaf1

Browse files
committed
Merge pull request #30 from codeclimate/pb-fix-error-handling
Fix invocation error handling
2 parents 5b2cdf7 + 06e7a0d commit e70eaf1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/cc/service/invocation/with_error_handling.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def call
1010
@invocation.call
1111
rescue => ex
1212
@logger.error(error_message(ex))
13+
14+
nil
1315
end
1416

1517
private

test/invocation_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_error_handling
6666
i.with :error_handling, logger, "a_prefix"
6767
end
6868

69-
assert result.has_key?(:error)
69+
assert_nil result
7070
assert_equal 1, logger.logged_errors.length
7171
assert_match /^Exception invoking service: \[a_prefix\]/, logger.logged_errors.first
7272
end
@@ -81,7 +81,7 @@ def test_multiple_middleware
8181
i.with :error_handling, logger
8282
end
8383

84-
assert result.has_key?(:error)
84+
assert_nil result
8585
assert_equal 1 + 3, service.receive_count
8686
assert_equal 1, logger.logged_errors.length
8787
end

0 commit comments

Comments
 (0)