~singpolyma/sgx-jmp

0c7dffd457731995a5f7dd3e4a0019acf765fb77 — Stephen Paul Weber 1 year, 7 months ago 51b5926
Fix no customer catch
1 files changed, 6 insertions(+), 6 deletions(-)

M sgx_jmp.rb
M sgx_jmp.rb => sgx_jmp.rb +6 -6
@@ 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