Track error in stats

 @param [String] component reporting error
 @param [Exception] exception to be tracked
 @param [Packet, Hash, NilClass] packet associated with exception

 @return [TrueClass] always true
354834
def track(component, exception, packet = nil)
      if @exception_stats
        component = component.class.name.split("::").last.snake_case unless component.is_a?(String)
        @exception_stats.track(component, exception, packet)
      end
      true
    end
1299109
def notify_callback
      Proc.new do |exception, packet, agent, component|
        notify(exception, packet, agent, component)
      end
    end
942429
def exception_logger(error)
      Rails.logger.error("\n#{error.class} #{error.message} in #{error.backtrace.first}")
      Rails.logger.error(error.backtrace[1..50].each { |line|
        line.gsub(/#{Rails.root.to_s}/, '')
      }.join("\n"))
    end
652046
def _handle_fault client, result
    if result.nil?
      STDERR.puts "Client connection failed:\n\tResult code #{client.response_code}, Fault: #{client.fault_string}" if Wbem.debug
      return true
    end
    if result.fault?
      fault = Openwsman::Fault.new result
      if Wbem.debug
        STDERR.puts "Client protocol failed for (#{client})"
        STDERR.puts "\tFault code #{fault.code}, subcode #{fault.subcode}"
        STDERR.puts "\t\treason #{fault.reason}"
        STDERR.puts "\t\tdetail #{fault.detail}"
      end
      return true
    end
    false
  end
889328
def set_exception(self, exc_class, exc_info, exc_stack):
        

        if self.is_finished():
            raise InternalError("set_exception called on finished AsynchronousResponse",
                                result=self._result, exception=self._exception)

        self._exception = (exc_class, exc_info, exc_stack)
        self.finish()
760160
def thread_tracker_exception(self, raised_exception):
		
		print('Thread tracker execution was stopped by the exception. Exception: %s' % str(raised_exception))
		print('Traceback:')
		print(traceback.format_exc())
438078
def should_retry_on(self, exception_class, logger=None):
        
        for n in (self.retry_on or []):
            try:
                if issubclass(exception_class, import_attribute(n)):
                    return True
            except TaskImportError:
                if logger:
                    logger.error('should_retry_on could not import class',
                                 exception_name=n)
        return False
1024940
def base_exception_handler(*args):
    

    header, frames, trcback = format_report(*extract_exception(*args))

    LOGGER.error("!> {0}".format(Constants.logging_separators))
    map(lambda x: LOGGER.error("!> {0}".format(x)), header)

    LOGGER.error("!> {0}".format(Constants.logging_separators))
    map(lambda x: LOGGER.error("!> {0}".format(x)), frames)

    LOGGER.error("!> {0}".format(Constants.logging_separators))
    sys.stderr.write("\n".join(trcback))

    return True
1304859
function report (ex) {
            var args = _slice.call(arguments, 1);
            if (lastExceptionStack) {
                if (lastException === ex) {
                    return; // already caught by an inner catch block, ignore
                } else {
                    var s = lastExceptionStack;
                    lastExceptionStack = null;
                    lastException = null;
                    notifyHandlers.apply(null, [s, null].concat(args));
                }
            }

            var stack = TraceKit.computeStackTrace(ex);
            lastExceptionStack = stack;
            lastException = ex;

            // If the stack trace is incomplete, wait for 2 seconds for
            // slow slow IE to see if onerror occurs or not before reporting
            // this exception; otherwise, we will end up with an incomplete
            // stack trace
            window.setTimeout(function() {
                if (lastException === ex) {
                    lastExceptionStack = null;
                    lastException = null;
                    notifyHandlers.apply(null, [stack, null].concat(args));
                }
            }, (stack.incomplete ? 2000 : 0));

            throw ex; // re-throw to propagate to the top level (and cause window.onerror)
        }
49755
def handle_exception(example)
      if example.instance_variable_get(:@exception)
        if metadata[:background]
          skip_examples_after(example, ancestors[1])
        else
          skip_examples_after(example)
        end
      end
    end
86569
private void trackErrorPages(final BundleContext bundleContext) {
		final ServiceTracker<ErrorPageMapping, ErrorPageWebElement> errorPagesTracker = ErrorPageMappingTracker
				.createTracker(extenderContext, bundleContext);
		errorPagesTracker.open();
		trackers.add(0, errorPagesTracker);
	}
284263
def save
      Bugsnag.notify(exception, true) do |report|
        report.severity = "error"
        report.severity_reason = {
          :type => Bugsnag::Report::UNHANDLED_EXCEPTION_MIDDLEWARE,
          :attributes => FRAMEWORK_ATTRIBUTES
        }

        context = "#{payload['class']}@#{queue}"
        report.meta_data.merge!({:context => context, :payload => payload})
        report.context = context
      end
    end
1002664
def _recordAndPrintHeadline(self, test, error_class, artifact):
        
        # We duplicate the errorclass handling from super rather than calling
        # it and monkeying around with showAll flags to keep it from printing
        # anything.
        is_error_class = False
        for cls, (storage, label, is_failure) in self.errorClasses.items():
            if isclass(error_class) and issubclass(error_class, cls):
                if is_failure:
                    test.passed = False
                storage.append((test, artifact))
                is_error_class = True
        if not is_error_class:
            self.errors.append((test, artifact))
            test.passed = False

        is_any_failure = not is_error_class or is_failure
        self._printHeadline(label if is_error_class else 'ERROR',
                            test,
                            is_failure=is_any_failure)
        return is_any_failure
1237897
def standard_exception_handling
      begin
        yield
      rescue SystemExit => ex
        # Exit silently with current status
        raise
      rescue OptionParser::InvalidOption => ex
        # Exit silently
        exit(false)
      rescue Exception => ex
        # Exit with error message
        $stderr.puts "#{name} aborted!"
        $stderr.puts ex.message
        if options.trace
          $stderr.puts ex.backtrace.join("\n")
        else
          $stderr.puts ex.backtrace.find {|str| str =~ /#{@rakefile}/ } || ""
          $stderr.puts "(See full trace by running task with --trace)"
        end
        exit(false)
      end
    end
541254
def error
      @values.each_pair{|observable, value|
        return Error.new(observable, value) if Exception === value
      }
      return nil
    end
164085
def evaluate_exceptions(exceptions, options)
      exceptions.each do |exception|
        key = if exception.is_a?(Class) && exception <= Exception
          exception.name
        elsif exception.is_a?(String)
          exception
        else
          raise ArgumentError, "#{exception} isn't an Exception"
        end

        error_handlers << [key, options[:with]]
      end
    end
1096943
def backtrace(exc, level_meth = :error)
      return unless show_backtraces
      send(level_meth, "#{exc.class.class_name}: #{exc.message}")
      send(level_meth, "Stack trace:" +
        exc.backtrace[0..5].map {|x| "\n\t#{x}" }.join + "\n")
    end