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

Commit 70c2986

Browse files
author
Melanie Gilman
committed
Flag ignored service invocations
https://trello.com/c/1QAKfYtf Distinguish between service invocations that fail and service invocations that don't run because the service doesn't respond to an event without returning nil, since nil is an unexpected response in the middleware.
1 parent eb30cf4 commit 70c2986

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/cc/service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def receive
8888
end
8989
end
9090

91-
nil
91+
{ ok: false, ignored: true, message: "No service handler found" }
9292
end
9393

9494
private

test/service_test.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def test_nothing_has_a_handler
2626

2727
result = service.receive
2828

29-
assert_nil result
29+
assert_equal false, result[:ok]
30+
assert_true true, result[:ignored]
31+
assert_equal "No service handler found", result[:message]
3032
end
3133

3234
def test_post_success

0 commit comments

Comments
 (0)