Override implementation to report all exceptions to sentry.
        log_exception() is added in Tornado v3.1.
15259
def log_exception(self, typ, value, tb):
        
        rv = super(SentryMixin, self).log_exception(typ, value, tb)
        # Do not capture tornado.web.HTTPErrors outside the 500 range.
        if isinstance(value, WebHTTPError) and (value.status_code < 500 or value.status_code > 599):
            return rv
        self.captureException(exc_info=(typ, value, tb))
        return rv
103333
function(msg, options) {
    // config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
    // early call; we'll error on the side of logging anything called before configuration since it's
    // probably something you should see:
    if (
      !!this._globalOptions.ignoreErrors.test &&
      this._globalOptions.ignoreErrors.test(msg)
    ) {
      return;
    }

    options = options || {};
    msg = msg + ''; // Make sure it's actually a string

    var data = objectMerge(
      {
        message: msg
      },
      options
    );

    var ex;
    // Generate a "synthetic" stack trace from this point.
    // NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
    //       of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
    //       or if it catches a thrown object without a "stack" property.
    try {
      throw new Error(msg);
    } catch (ex1) {
      ex = ex1;
    }

    // null exception name so `Error` isn't prefixed to msg
    ex.name = null;
    var stack = TraceKit.computeStackTrace(ex);

    // stack[0] is `throw new Error(msg)` call itself, we are interested in the frame that was just before that, stack[1]
    var initialCall = isArray(stack.stack) && stack.stack[1];

    // if stack[1] is `Raven.captureException`, it means that someone passed a string to it and we redirected that call
    // to be handled by `captureMessage`, thus `initialCall` is the 3rd one, not 2nd
    // initialCall => captureException(string) => captureMessage(string)
    if (initialCall && initialCall.func === 'Raven.captureException') {
      initialCall = stack.stack[2];
    }

    var fileurl = (initialCall && initialCall.url) || '';

    if (
      !!this._globalOptions.ignoreUrls.test &&
      this._globalOptions.ignoreUrls.test(fileurl)
    ) {
      return;
    }

    if (
      !!this._globalOptions.whitelistUrls.test &&
      !this._globalOptions.whitelistUrls.test(fileurl)
    ) {
      return;
    }

    // Always attempt to get stacktrace if message is empty.
    // It's the only way to provide any helpful information to the user.
    if (this._globalOptions.stacktrace || options.stacktrace || data.message === '') {
      // fingerprint on msg, not stack trace (legacy behavior, could be revisited)
      data.fingerprint = data.fingerprint == null ? msg : data.fingerprint;

      options = objectMerge(
        {
          trimHeadFrames: 0
        },
        options
      );
      // Since we know this is a synthetic trace, the top frame (this function call)
      // MUST be from Raven.js, so mark it for trimming
      // We add to the trim counter so that callers can choose to trim extra frames, such
      // as utility functions.
      options.trimHeadFrames += 1;

      var frames = this._prepareFrames(stack, options);
      data.stacktrace = {
        // Sentry expects frames oldest to newest
        frames: frames.reverse()
      };
    }

    // Make sure that fingerprint is always wrapped in an array
    if (data.fingerprint) {
      data.fingerprint = isArray(data.fingerprint)
        ? data.fingerprint
        : [data.fingerprint];
    }

    // Fire away!
    this._send(data);

    return this;
  }
525175
public static RuntimeException handleExceptionAndReturnRuntimeEx(Logger log,
            Throwable throwable, String method, Object... params) {
        handleException(log, throwable, method, params);
        return new RuntimeException(throwable);
    }
1023648
protected void registerLoggedException(Throwable exception) {
		SpringBootExceptionHandler handler = getSpringBootExceptionHandler();
		if (handler != null) {
			handler.registerLoggedException(exception);
		}
	}
547454
def sentry_exception (e, request, message = None):
  """"""
  try:
    logtool.log_fault (e, message = message, level = logging.INFO)
    data = {
      "task": task,
      "request": {
        "args": task.request.args,
        "callbacks": task.request.callbacks,
        "called_directly": task.request.called_directly,
        "correlation_id": task.request.correlation_id,
        "delivery_info": task.request.delivery_info,
        "errbacks": task.request.errbacks,
        "eta": task.request.eta,
        "expires": task.request.expires,
        "headers": task.request.headers,
        "hostname": task.request.hostname,
        "id": task.request.id,
        "is_eager": task.request.is_eager,
        "kwargs": task.request.kwargs,
        "origin": task.request.origin,
        "parent_id": task.request.parent_id,
        "reply_to": task.request.reply_to,
        "retries": task.request.retries,
        "root_id": task.request.root_id,
        "task": task.request.task,
        "taskset": task.request.taskset,
        "timelimit": task.request.timelimit,
        "utc": task.request.utc,
      },
    }
    if message:
      data["message"] = message
    SENTRY.extra_context (data)
    einfo = sys.exc_info ()
    rc = SENTRY.captureException (einfo)
    del einfo
    LOG.error ("Sentry filed: %s", rc)
  except Exception as ee:
    logtool.log_fault (ee, message = "FAULT: Problem logging exception.",
                       level = logging.INFO)
294934
@Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable exception) throws Exception {
    if (exception instanceof FrameDecodingException) {
      int streamId = ((FrameDecodingException) exception).streamId;
      LOG.debug("[{}] Error while decoding response on stream id {}", logPrefix, streamId);
      if (streamId >= 0) {
        // We know which request matches the failing response, fail that one only
        ResponseCallback responseCallback = inFlight.get(streamId);
        if (responseCallback != null) {
          try {
            responseCallback.onFailure(exception.getCause());
          } catch (Throwable t) {
            Loggers.warnWithException(
                LOG, "[{}] Unexpected error while invoking failure handler", logPrefix, t);
          }
        }
        release(streamId, ctx);
      } else {
        Loggers.warnWithException(
            LOG,
            "[{}] Unexpected error while decoding incoming event frame",
            logPrefix,
            exception.getCause());
      }
    } else {
      // Otherwise fail all pending requests
      abortAllInFlight(
          (exception instanceof HeartbeatException)
              ? (HeartbeatException) exception
              : new ClosedConnectionException("Unexpected error on channel", exception));
      ctx.close();
    }
  }
176360
def log_exception(fn_name, exception, retry_count, **kwargs):
    
    _log_exception_hook(fn_name, exception, retry_count, **kwargs)
527823
@Override
    public void uncaughtException(Thread thread, Throwable thrown) {
        if (enabled) {
            logger.trace("Uncaught exception received.");

            EventBuilder eventBuilder = new EventBuilder()
                .withMessage(thrown.getMessage())
                .withLevel(Event.Level.FATAL)
                .withSentryInterface(new ExceptionInterface(thrown));

            try {
                Sentry.capture(eventBuilder);
            } catch (Exception e) {
                logger.error("Error sending uncaught exception to Sentry.", e);
            }
        }

        // taken from ThreadGroup#uncaughtException
        if (defaultExceptionHandler != null) {
            // call the original handler
            defaultExceptionHandler.uncaughtException(thread, thrown);
        } else if (!(thrown instanceof ThreadDeath)) {
            // CHECKSTYLE.OFF: RegexpSinglelineJava
            System.err.print("Exception in thread \"" + thread.getName() + "\" ");
            thrown.printStackTrace(System.err);
            // CHECKSTYLE.ON: RegexpSinglelineJava
        }
    }
521201
public void logError(String message, Exception exception) {
        if (!(logError || globalLog.logError))
            return;
	
        if (errorLog != null)
            log(errorLog, "ERROR", owner, message, exception);
        else 
            log(globalLog.errorLog, "ERROR", owner, message, exception);
    }
1201130
def _init_exception_logging(self, app):
        
        enabled = not app.config.get(CONF_DISABLE_EXCEPTION_LOGGING, False)

        if not enabled:
            return

        exception_telemetry_client = TelemetryClient(
            self._key, telemetry_channel=self._channel)

        @app.errorhandler(Exception)
        def exception_handler(exception):
            if HTTPException and isinstance(exception, HTTPException):
                return exception

            try:
                raise exception
            except Exception:
                exception_telemetry_client.track_exception()
            finally:
                raise exception

        self._exception_telemetry_client = exception_telemetry_client
694033
def _log_and_raise_exception(msg, data, cls=FoursquareException):
  """"""
  data = u'{0}'.format(data)
  # We put data as a argument for log.error() so error tracking systems such
  # as Sentry will properly group errors together by msg only
  log.error(u'{0}: %s'.format(msg), data)
  raise cls(u'{0}: {1}'.format(msg, data))
176443
function (errors, throwsErrors) {
                if (errors.length === 0) {
                    return true;
                }
                if (!throwsErrors) {
                    for (var i = 0; i < errors.length; i++) {
                        this.$logError(errors[i].msgId, errors[i].msgArgs);
                    }
                } else {
                    var error, logs = aria.core.Log;
                    // aria.core.Log may not be available
                    if (logs) {
                        var messages = [];
                        for (var i = 0; i < errors.length; i++) {
                            errors[i].message = logs.prepareLoggedMessage(errors[i].msgId, errors[i].msgArgs);
                            messages.push(errors[i].message);
                        }
                        error = new Error(messages.join('\n'));
                    } else {
                        error = new Error();
                    }
                    error.errors = errors;
                    throw error;
                }
                return false;
            }
114293
def process_uncaught_exception(self, e):
        """"""
        # Add information about the actual exception to the log message
        # This includes the file, line and piece of code causing the exception.
        # exc_info=True adds the full stack trace to the log message.
        exc_file_fullpath, exc_file, exc_lineno, exc_func, exc_line = (
            workflows.logging.get_exception_source()
        )
        added_information = {
            "workflows_exc_lineno": exc_lineno,
            "workflows_exc_funcName": exc_func,
            "workflows_exc_line": exc_line,
            "workflows_exc_pathname": exc_file_fullpath,
            "workflows_exc_filename": exc_file,
        }
        for field in filter(lambda x: x.startswith("workflows_log_"), dir(e)):
            added_information[field[14:]] = getattr(e, field, None)
        self.log.critical(
            "Unhandled service exception: %s", e, exc_info=True, extra=added_information
        )
379630
def exception_logging(exctype, value, tb):
    
    write_val = {'exception_type': str(exctype),
                 'message': str(traceback.format_tb(tb, 10))}
    logging.exception(str(write_val))
1014414
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
171622
public static void logException( Logger logger, Throwable t ) {
		logException( logger, Level.FINEST, t );
	}
777836
private void checkForLoggerParam() {
        if (Values.CONSTRUCTOR.equals(getNameConstantOperand())) {
            String cls = getClassConstantOperand();
            if ((cls.startsWith("java/") || cls.startsWith("javax/")) && cls.endsWith("Exception")) {
                String sig = getSigConstantOperand();
                List<String> types = SignatureUtils.getParameterSignatures(sig);
                if (types.size() <= stack.getStackDepth()) {
                    for (int i = 0; i < types.size(); i++) {
                        String parmSig = types.get(i);
                        if (Values.SIG_JAVA_LANG_STRING.equals(parmSig)) {
                            OpcodeStack.Item item = stack.getStackItem(types.size() - i - 1);
                            String cons = (String) item.getConstant();
                            if ((cons != null) && cons.contains("{}")) {
                                bugReporter.reportBug(new BugInstance(this, BugType.LO_EXCEPTION_WITH_LOGGER_PARMS.name(), NORMAL_PRIORITY).addClass(this)
                                        .addMethod(this).addSourceLine(this));
                                break;
                            }
                        }
                    }
                }
            }
        }
    }