Fix no customer catch

Stephen Paul Weber created

Change summary

sgx_jmp.rb | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

Detailed changes

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