Sha256: e7accc93d514baab449223803e347286aa604591fc11eec8225d5a0fdd26dca8

Contents?: true

Size: 794 Bytes

Versions: 7

Compression:

Stored size: 794 Bytes

Contents

require "rake"
require "rake/task"

module Sentry
  module Rake
    module Application
      def display_error_message(ex)
        Sentry.capture_exception(ex, hint: { background: false }) do |scope|
          task_name = top_level_tasks.join(' ')
          scope.set_transaction_name(task_name)
          scope.set_tag("rake_task", task_name)
        end if Sentry.initialized? && !Sentry.configuration.skip_rake_integration

        super
      end
    end

    module Task
      def execute(args=nil)
        return super unless Sentry.initialized? && Sentry.get_current_hub

        Sentry.get_current_hub.with_background_worker_disabled do
          super
        end
      end
    end
  end
end

Rake::Application.prepend(Sentry::Rake::Application)
Rake::Task.prepend(Sentry::Rake::Task)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sentry-ruby-core-4.8.0 lib/sentry/rake.rb
sentry-ruby-core-4.7.3 lib/sentry/rake.rb
sentry-ruby-core-4.7.2 lib/sentry/rake.rb
sentry-ruby-core-4.7.1 lib/sentry/rake.rb
sentry-ruby-core-4.7.0 lib/sentry/rake.rb
sentry-ruby-core-4.6.5 lib/sentry/rake.rb
sentry-ruby-core-4.6.4 lib/sentry/rake.rb