Attach appropriate error information to tracer_h.

    If e_val and e_ty are None, the current exception is used.
328523
def error_from_exc(nsdk, tracer_h, e_val=None, e_ty=None):
    """"""

    if not tracer_h:
        return

    if e_ty is None and e_val is None:
        e_ty, e_val = sys.exc_info()[:2]
    if e_ty is None and e_val is not None:
        e_ty = type(e_val)
    nsdk.tracer_error(tracer_h, getfullname(e_ty), str(e_val))
1316452
def log_exception(func, handler, args, kwargs):
    
    # safe-guard: expected arguments -> log_exception(self, typ, value, tb)
    value = args[1] if len(args) == 3 else None
    if value is None:
        return func(*args, **kwargs)

    tracing = handler.settings.get('opentracing_tracing')
    if not isinstance(value, HTTPError) or 500 <= value.status_code <= 599:
        tracing._finish_tracing(handler, error=value)

    return func(*args, **kwargs)
667240
def excepthook(cls, error, trace):
    
    global _excepthooks
    new_hooks = []

    for hook_ref in _excepthooks:
        hook = hook_ref()
        if hook:
            hook(cls, error, trace)
            new_hooks.append(hook_ref)

    _excepthook = new_hooks
    sys.__excepthook__(cls, error, trace)
1305570
def _exception_default_handler(self, e):
        
        if isinstance(e, HTTPError):
            if e.log_message:
                format = "%d %s: " + e.log_message
                args = [e.status_code, self._request_summary()] + list(e.args)
                app_log.warning(format, *args)
            if e.status_code not in httplib.responses:
                app_log.error("Bad HTTP status code: %d", e.status_code)
                self.send_error(500, exc_info=sys.exc_info())
            else:
                self.send_error(e.status_code, exc_info=sys.exc_info())
        else:
            app_log.error("Uncaught exception %s\n%r", self._request_summary(),
                          self.request, exc_info=True)
            self.send_error(500, exc_info=sys.exc_info())
776660
def set_exception_info(self, exception, traceback):
        
        with self._condition:
            self._exception = exception
            self._traceback = traceback
            self._state = FINISHED
            for waiter in self._waiters:
                waiter.add_exception(self)
            self._condition.notify_all()
        self._invoke_callbacks()
568294
def handle_error(self, exc=None):
    """"""
    if exc:
      NailgunProtocol.send_stderr(self.request, traceback.format_exc())
    failure_code = 1
    NailgunProtocol.send_exit_with_code(self.request, failure_code)
46930
static void showError(Exception e) {
    String stackTrace = org.languagetool.tools.Tools.getFullStackTrace(e);
    String msg = "<html><p style='width: 600px;'>" + StringTools.escapeHTML(stackTrace);
    JOptionPane.showMessageDialog(null, msg, "Error", JOptionPane.ERROR_MESSAGE);
    e.printStackTrace();
  }
352559
def error2str(e):
    
    out = StringIO()
    traceback.print_exception(None, e, e.__traceback__, file=out)
    out.seek(0)
    return out.read()
1296023
public static void tracePreInvokeException(EJSDeployedSupport s,
                                               EJSWrapperBase wrapper,
                                               Throwable t)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        {
            StringBuffer sbuf = new StringBuffer();

            sbuf
                            .append(MthdPreInvokeException_Type_Str).append(DataDelimiter)
                            .append(MthdPreInvokeException_Type).append(DataDelimiter);

            writeDeployedSupportInfo(s, sbuf, wrapper, t);

            Tr.debug(tc, sbuf.toString());
        }
    }
1263784
public static void exception(TraceComponent tc, Exception e) {
    if(isTracing()) SibTr.exception(tc, e);

  }
115617
def add_cause(self, error: Exception):
        ''''''
        self.add_info('Cause error', '{0} - {1}'.format(type(error).__name__, error))
1061214
def ExceptionHookPDB(exctype, value, tb):
    '''
    

    '''

    for line in traceback.format_exception_only(exctype, value):
        log.error(line.replace('\n', ''))
    for line in traceback.format_tb(tb):
        log.error(line.replace('\n', ''))
    sys.__excepthook__(exctype, value, tb)
    pdb.pm()
929471
def should_hide_traceback(e):
    
    if type(e) in {WrongTypeCreatedError, CascadeError, TypeInformationRequiredError}:
        return True
    elif type(e).__name__ in {'InvalidAttributeNameForConstructorError', 'MissingMandatoryAttributeFiles'}:
        return True
    else:
        return False
170355
def build_fault(cls, e, tb, include_traceback=False):
    
    if hasattr(cls, '_amf_code'):
        code = cls._amf_code
    else:
        code = cls.__name__

    details = None

    if include_traceback:
        details = traceback.format_exception(cls, e, tb)

    return remoting.ErrorFault(code=code, description=unicode(e), details=details)
588576
def forward_exception(self, etype, evalue, tb):
        
        self._excepthook(etype, evalue, tb)
89336
def str_traceback(error, tb):
    
    if not isinstance(tb, types.TracebackType):
        return tb

    return ''.join(traceback.format_exception(error.__class__, error, tb))
815415
def _format_exception(err, is_failure, stdout=None, stderr=None):
    """"""
    exctype, value, tb = err
    # Skip test runner traceback levels
    while tb and _is_relevant_tb_level(tb):
        tb = tb.tb_next

    if is_failure:
        # Skip assert*() traceback levels
        length = _count_relevant_tb_levels(tb)
        msgLines = traceback.format_exception(exctype, value, tb, length)
    else:
        msgLines = traceback.format_exception(exctype, value, tb)

    encoding = locale.getpreferredencoding()
    msgLines = [_decode(line, encoding) for line in msgLines]

    if stdout:
        if not stdout.endswith('\n'):
            stdout += '\n'
        msgLines.append(STDOUT_LINE % stdout)
    if stderr:
        if not stderr.endswith('\n'):
            stderr += '\n'
        msgLines.append(STDERR_LINE % stderr)
    return ''.join(msgLines)