self.capture_exception

in lib/gdk/telemetry.rb [128:150]


    def self.capture_exception(message, attachment: nil)
      return unless telemetry_enabled?

      if message.is_a?(Exception)
        exception = message.dup
      else
        exception = StandardError.new(message)
        exception.set_backtrace(caller)
      end

      
      exception.set_backtrace(exception.backtrace.drop(1)) if exception.backtrace

      init_sentry

      Sentry.configure_scope do |scope|
        scope.set_context('gdk', payload)
      end

      Sentry.add_attachment(**attachment) if attachment
      Sentry.capture_exception(exception)
    end