Sha256: 9e7bfd234ac0c351e3767d7cd8e50e36d827c9603cc695215f1925ebc5b7e6ec

Contents?: true

Size: 716 Bytes

Versions: 1

Compression:

Stored size: 716 Bytes

Contents

# frozen_string_literal: true

require "rake"
require "rake/task"

module Sentry
  module Rake
    module Application
      def display_error_message(ex)
        Sentry.capture_exception(ex) 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

        super
      end
    end
  end
end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sentry-ruby-core-4.8.1 lib/sentry/rake.rb