diff --git a/lib/patches_for_sentry.rb b/lib/patches_for_sentry.rb index 48ff7c3312af2c0af338b0e5e29622933601cf16..93a556c78325b4402ee5fdd75568837ba38d1fa2 100644 --- a/lib/patches_for_sentry.rb +++ b/lib/patches_for_sentry.rb @@ -63,12 +63,13 @@ module SentryIQManager transaction = Sentry.get_current_scope.get_transaction return yield unless transaction&.sampled - span = transaction.start_child( - op: "xmpp.iq", - description: description - ) + span = transaction.start_child(op: "xmpp.iq", description: description) - yield.then { span.finish } + yield.then { span.finish }.catch do |e| + span.set_status("internal_error") + span.finish + EMPromise.reject(e) + end end def stanza_description(stanza)