Try to get a crash signature from the given error_line string.
167828
def get_crash_signature(error_line):
    """"""
    search_term = None
    match = CRASH_RE.match(error_line)
    if match and is_helpful_search_term(match.group(1)):
        search_term = match.group(1)
    return search_term
914501
def error_catch(f):
    """"""
    @wraps(f)
    def wrapper(*args, **kw):
        instance = args[0]
        try:
            result = f(*args, **kw)
            if isinstance(result, tuple):
                return jsonify(result[0]), result[1]
            else:
                return jsonify(result), 200
        except Exception as e:
            ret_dict = instance._create_ret_object(instance.FAILURE, None,
                                                   True,
                                                   instance.UNKNOWN_ERROR)
            log_dict = deepcopy(ret_dict)
            log_dict['error']['cause'] = e.message
            log_dict['error']['exception'] = str(e)
            log_dict['error']['ex'] = traceback.format_exc()
            instance.logger.error("Uncaught Exception Thrown", log_dict)
            return jsonify(ret_dict), 500
    return wrapper
726220
def log_fault_exc_str (exc, # pylint: disable=W0613
                       message = "", level = logging.CRITICAL,
                       traceback = False):
  
  return log_fault_info_str (sys.exc_info (), message = message,
                             level = level, traceback = traceback)
443088
def getFailureMessage(failure):
    
    str(failure.type)
    failure.getErrorMessage()
    if len(failure.frames) == 0:
        return "failure %(exc)s: %(msg)s" % locals()

    (func, filename, line, some, other) = failure.frames[-1]
    filename = scrubFilename(filename)
    return "failure %(exc)s at %(filename)s:%(line)s: %(func)s(): %(msg)s" \
        % locals()
913046
def nvrtcGetErrorString(self, code):
        
        code_int = c_int(code)
        res = self._lib.nvrtcGetErrorString(code_int)
        return res.decode('utf-8')
1307194
def parse_error(
        self, exception=ParseError, *args
    ):  # type: (ParseError.__class__, ...) -> ParseError
        
        line, col = self._to_linecol()

        return exception(line, col, *args)
406708
def clean_error(err):
    
    if err:
        decoded = err.decode('utf-8')
        try:
            return decoded.split('\r\n')[-2]
        except Exception:
            return decoded
    return 'There was an error.'
990362
def errorstr(self, space, use_repr=False):
        ""
        w_value = self.get_w_value(space)
        if space is None:
            # this part NOT_RPYTHON
            exc_typename = str(self.w_type)
            exc_value = str(w_value)
        else:
            w = space.wrap
            if space.is_w(space.type(self.w_type), space.w_text):
                exc_typename = space.str_w(self.w_type)
            else:
                exc_typename = space.str_w(
                    space.getattr(self.w_type, w('__name__')))
            if space.is_w(w_value, space.w_None):
                exc_value = ""
            else:
                try:
                    if use_repr:
                        exc_value = space.str_w(space.repr(w_value))
                    else:
                        exc_value = space.str_w(space.str(w_value))
                except OperationError:
                    # oups, cannot __str__ the exception object
                    exc_value = "<oups, exception object itself cannot be str'd>"
        if not exc_value:
            return exc_typename
        else:
            return '%s: %s' % (exc_typename, exc_value)
856867
public String getLastError(int iErrorCode)
    {
        if ((m_strLastError == null) || ((iErrorCode != 0) && (iErrorCode != m_iLastErrorCode)))
            return Constants.BLANK;
        String string = m_strLastError;
        m_strLastError = null;
        return string;
    }
540217
def decodeRPCErrorMsg(e):
    
    found = re.search(
        (
            "(10 assert_exception: Assert Exception\n|"
            "3030000 tx_missing_posting_auth)"
            ".*: (.*)\n"
        ),
        str(e),
        flags=re.M,
    )
    if found:
        return found.group(2).strip()
    else:
        return str(e)
146305
def get_error(self):
        """"""
        col_offset = -1
        if self.node is not None:
            try:
                col_offset = self.node.col_offset
            except AttributeError:
                pass
        try:
            exc_name = self.exc.__name__
        except AttributeError:
            exc_name = str(self.exc)
        if exc_name in (None, 'None'):
            exc_name = 'UnknownError'

        out = ["   %s" % self.expr]
        if col_offset > 0:
            out.append("    %s^^^" % ((col_offset)*' '))
        out.append(str(self.msg))
        return (exc_name, '\n'.join(out))
120980
def extract_error(checker, *a, **kw):
    

    res = catch_error(checker, *a, **kw)
    if isinstance(res, DataError):
        return res.as_dict()
    return res
536162
def _get_class_name(error_code):
    
    if isinstance(error_code, int):
        return KNOWN_BASE_CLASSES.get(
            error_code, 'RPCError' + str(error_code).replace('-', 'Neg')
        )

    return snake_to_camel_case(
        error_code.replace('FIRSTNAME', 'FIRST_NAME').lower(), suffix='Error')
799573
def exc_message(exc_info):
    """"""
    exc = exc_info[1]
    if exc is None:
        # str exception
        result = exc_info[0]
    else:
        try:
            result = str(exc)
        except UnicodeEncodeError:
            try:
                result = unicode(exc)  # flake8: noqa
            except UnicodeError:
                # Fallback to args as neither str nor
                # unicode(Exception(u'\xe6')) work in Python < 2.6
                result = exc.args[0]
    return result
176932
def parse_error(lines)
      if lines.size == 1
        case lines.first
          when '# Unknown service' then raise UnknownService
          when '# Bad exit'        then raise BadExit
        end
      end
    end
1052795
def _get_error_message(response):
    """"""
    try:
        data = response.json()
        if "error_description" in data:
            return data['error_description']
        if "error" in data:
            return data['error']
    except Exception:
        pass

    return "Unknown error"
673203
def _get_err_msg(row, col, fld, val, prt_flds):
        """"""
        import traceback
        traceback.print_exc()
        err_msg = (
            "ROW({R}) COL({C}) FIELD({F}) VAL({V})\n".format(R=row, C=col, F=fld, V=val),
            "PRINT FIELDS({N}): {F}".format(N=len(prt_flds), F=" ".join(prt_flds)))
        return "\n".join(err_msg)