Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active Job Integration looses extra context #916

Closed
getand opened this issue Sep 10, 2019 · 2 comments
Closed

Active Job Integration looses extra context #916

getand opened this issue Sep 10, 2019 · 2 comments

Comments

@getand
Copy link

getand commented Sep 10, 2019

Active Job is loosing the extra context due to the ensure block here: https://github.com/getsentry/raven-ruby/blob/master/lib/raven/integrations/rails/active_job.rb#L25-L27

Implementation should be like this: (If wanted I can make a PR)

module ActiveJobExtensions
      def capture_and_reraise_with_sentry(job, block)
        block.call
        clear_context_and_breadcrumb_buffer
      rescue Exception => exception # rubocop:disable Lint/RescueException
        if rescue_with_handler(exception)
          clear_context_and_breadcrumb_buffer
          return
        end

        unless already_supported_by_specific_integration?(job)
          Raven.capture_exception(exception, :extra => raven_context(job))
          clear_context_and_breadcrumb_buffer
        end

        raise exception
      end

      private

      def clear_context_and_breadcrumb_buffer
        Context.clear!
        BreadcrumbBuffer.clear!
      end
    end
@st0012 st0012 added this to Needs triage in 3.x Aug 6, 2020
@st0012
Copy link
Collaborator

st0012 commented Aug 27, 2020

@getand sorry for the late reply, but are you still willing to open a PR for this?

@st0012
Copy link
Collaborator

st0012 commented Jan 3, 2021

@getand can you provide reproduction steps for the original issue you were having? I'd like to confirm if the issue has been fixed in the new SDK.

@st0012 st0012 closed this as completed Jan 31, 2021
3.x automation moved this from Needs triage to Closed Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3.x
  
Closed
Development

No branches or pull requests

2 participants