From 0c7dffd457731995a5f7dd3e4a0019acf765fb77 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 25 Oct 2021 12:52:27 -0500 Subject: [PATCH] Fix no customer catch --- sgx_jmp.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 9614ab4..1284779 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -259,7 +259,7 @@ message( from: /(\A|@)#{CONFIG[:sgx]}(\/|\Z)/ ) do |m| StatsD.increment("inbound_group_text") - sentry_hub = new_sentry_hub(m, name: "message") + sentry_hub = new_sentry_hub(m, name: "inbound_group_text") address = m.find("ns:addresses", ns: ADDRESSES_NS).first &.find("ns:address", ns: ADDRESSES_NS) @@ -272,7 +272,7 @@ message( address["jid"] = customer.jid.to_s BLATHER << m }.catch_only(CustomerRepo::NotFound) { |e| - BLATHER << iq.as_error("forbidden", :auth, e.message) + BLATHER << m.as_error("forbidden", :auth, e.message) }.catch { |e| panic(e, sentry_hub) } end @@ -304,13 +304,13 @@ message do |m| ExpiringLock.new("jmp_usage_notify-#{customer.customer_id}").with do BLATHER.join(CONFIG[:notify_admin], "sgx-jmp") BLATHER.say( - CONFIG[:notify_admin], - "#{customer.customer_id} has used #{usage} " \ - "messages since #{today - 30}", - :groupchat + CONFIG[:notify_admin], "#{customer.customer_id} has used #{usage} " \ + "messages since #{today - 30}", :groupchat ) end end + }.catch_only(CustomerRepo::NotFound) { |e| + BLATHER << m.as_error("forbidden", :auth, e.message) }.catch { |e| panic(e, sentry_hub) } end -- 2.38.5