Skip to content

Event is not compatible with ActiveJob 6+ #1227

@sujh

Description

@sujh

Describe the bug

Trying to use Sentry.capture_exception(error) to capture a StandardError and send it asynchronously , but it failed to enqueue and reported

async event sending failed: Unsupported argument type: StandardError.

The failed reason can be found here: https://github.com/rails/rails/blob/v6.0.3.4/activejob/lib/active_job/serializers.rb#L28. It seems like ActiveJob 6 can't serialize an Exception object

Expected behavior
Event should be compatible with ActiveJob 6+

Environment

  • Ruby Version: 2.7.2
  • SDK Version: 4.1.4
  • Integration Versions (if any):
  • Rails 6.0.3.4, Sidekiq 6.1.2

Sentry-ruby Config

    Sentry.init do |config|
      config.breadcrumbs_logger = [:active_support_logger]
      config.before_send = lambda do |event, hint|
        event.modules.clear
        event
      end
      config.async = lambda { |event, hint| SentryJob.perform_later(event, hint) }
    end

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions