def report_internal_error(exception)
      log_error '[Rollbar] Reporting internal error encountered while sending data to Rollbar.'

      configuration.execute_hook(:on_report_internal_error, exception)

      begin
        item = build_item('error', nil, exception, { :internal => true }, nil)
      rescue StandardError => e
        send_failsafe('build_item in exception_data', e)
        log_error "[Rollbar] Exception: #{exception}"
        return
      end

      begin
        process_item(item)
      rescue StandardError => e
        send_failsafe('error in process_item', e)
        log_error "[Rollbar] Item: #{item}"
        return
      end

      begin
        log_instance_link(item['data'])
      rescue StandardError => e
        send_failsafe('error logging instance link', e)
        log_error "[Rollbar] Item: #{item}"
        return
      end
    end
def report_internal_error(exception)
      log_error '[Rollbar] Reporting internal error encountered while sending data to Rollbar.'

      configuration.execute_hook(:on_report_internal_error, exception)

      begin
        item = build_item('error', nil, exception, { :internal => true }, nil)
      rescue StandardError => e
        send_failsafe('build_item in exception_data', e)
        log_error "[Rollbar] Exception: #{exception}"
        return
      end

      begin
        process_item(item)
      rescue StandardError => e
        send_failsafe('error in process_item', e)
        log_error "[Rollbar] Item: #{item}"
        return
      end

      begin
        log_instance_link(item['data'])
      rescue StandardError => e
        send_failsafe('error logging instance link', e)
        log_error "[Rollbar] Item: #{item}"
        return
      end
    end
Reports an internal error in the Rollbar library. This will be reported within the configured
 Rollbar project. We'll first attempt to provide a report including the exception traceback.
 If that fails, we'll fall back to a more static failsafe response.