From 83603be964527ea151520d36cf61040c51cc4079 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 10 Aug 2021 09:48:35 -0500 Subject: [PATCH] Since Command#finish causes an error, a then off the end won't work --- sgx_jmp.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index c2f8db1..37e1269 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -386,7 +386,12 @@ Command.new( }.then { |customer| Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Registration.for")) Registration.for(customer, web_register_manager).then(&:write) - }.then { StatsD.increment("registration.completed") } + }.then { + StatsD.increment("registration.completed") + }.catch_only(ErrorToSend) do |e| + StatsD.increment("registration.completed") + EMPromise.reject(e) + end }.register(self).then(&CommandList.method(:register)) # Commands that just pass through to the SGX -- 2.38.5