From fa5ad5326a906a6a3ebc65d9480a25cd42a721fe Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Thu, 27 Mar 2014 13:39:48 -0400 Subject: [PATCH] Ensure metrics middleware returns result of inner call --- lib/cc/service/invocation/with_metrics.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cc/service/invocation/with_metrics.rb b/lib/cc/service/invocation/with_metrics.rb index f2a4f6b..7dde70d 100644 --- a/lib/cc/service/invocation/with_metrics.rb +++ b/lib/cc/service/invocation/with_metrics.rb @@ -7,8 +7,10 @@ def initialize(invocation, statsd, prefix = nil) end def call - @invocation.call + result = @invocation.call @statsd.increment(success_key) + + result rescue => ex @statsd.increment(error_key(ex)) raise ex