fills in and returns an Error object that reports the specified error name and message.
960263
def as_error(self) :
        ""
        result = dbus.Error.init()
        result.set(self.args[0], self.args[1])
        return \
            result
841063
def _error_message(self):
        
        body = self._deserialize()
        return body.get('message', body) if isinstance(body, dict) else body
794732
def _server_error_message(url, message):
    """"""
    msg = _error_message.format(url=url, message=message)
    log.error(msg)
    return msg
373773
function NameError(message) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'Middleware Name Error';
  this.message = message || 'The argument must be a named function or supply a name';
}
95854
function toError(msg, cause) {
  var err = new Error(msg);
  err.cause = cause;
  return err;
}
300383
function getNamedError(obj) {
  if (obj && obj instanceof Error && 'name' in obj) {
    var Constructor = exports[obj.name];
    if (typeof Constructor === 'function') {
      var res = new Constructor(obj.message);
      if (res) {
        res.stack = obj.stack;
        return res;
      }
    }
  }
  return obj;
}
167711
def onerror(self, message, source, lineno, colno):
        """"""
        return (message, source, lineno, colno)
58475
def _on_process_error(self, error):
        
        if self is None:
            return
        err = PROCESS_ERROR_STRING[error]
        self._formatter.append_message(err + '\r\n', output_format=OutputFormat.ErrorMessageFormat)
604506
def message(self) -> str:
        """"""
        ret = '{}: {}'.format(self.code, self.short_desc)
        if self.context is not None:
            specific_error_msg = self.context.format(*self.parameters)
            ret += ' ({})'.format(specific_error_msg)
        return ret
1321551
def get_error_name(error_const):
    
    for name, val in consts.ERROR_MAPPING.items():
        if val == error_const:
            return name
    raise ErrorLevelError('Unknown error level "{0}"'.format(error_const))
670319
def error(errors):
    """"""
    e_tree, e_oaipmh = envelope()
    for code, message in errors:
        e_error = SubElement(e_oaipmh, etree.QName(NS_OAIPMH, 'error'))
        e_error.set('code', code)
        e_error.text = message
    return e_tree
584372
def get_errors(error_string):
    '''
    

    '''

    lines = error_string.splitlines()
    error_lines = tuple(line for line in lines if line.find('Error') >= 0)
    if len(error_lines) > 0:
        return '\n'.join(error_lines)
    else:
        return error_string.strip()
447233
def handle_errors(resp):
    """"""
    if resp.status_code == 400:
        raise ApiException(json.loads(resp.content).get('message'))
    return resp
776345
def errorhandle(self, resp):            
        """"""
        if self.format == 'json':
            parsed = xmltodict.parse(resp)
            errors = parsed[self.RESPONSE_TOKEN][self.ERROR_TOKEN]
            # Create list of errors if more than one error response is given
            if type(errors) is list and len(errors) > 1:
                messages = ", ".join([" ".join(["{}: {}".format(k,v) for k, v in e.items()]) for e in errors])
            else:
                overlimit = any('transaction limit' in msg.lower() for msg in errors.values())
                if overlimit:
                    raise APILimitExceeded("This API key has used up its daily quota of calls.")
                else:    
                    messages = " ".join(["{}: {}".format(k,v) for k, v in errors.items()])    
        elif self.format == 'xml':
            import xml.etree.ElementTree as ET
            errors = ET.fromstring(resp).findall(self.ERROR_TOKEN)
            messages = ", ".join(err.find('msg').text for err in errors)
        else:
            raise ValueError("Invalid API response format specified: {}." % self.format)        
        
        raise BustimeError("API returned: {}".format(messages))
1327430
def error_name(self) :
        ""
        result = dbus.dbus_message_get_error_name(self._dbobj)
        if result != None :
            result = result.decode()
        #end if
        return \
            result
1059032
function formatError(e) {
  if (!e.err) return e.message;
  if (e.err.message) return e.err.message;
  return JSON.stringify(e.err);
}
396916
def error_message_and_exit(message, error_result):
    """"""
    if message:
        error_message(message)
    puts(json.dumps(error_result, indent=2))
    sys.exit(1)