Register a new error code
5905
def register_error_code(code, exception_type, domain='core'):
        """"""
        Logger._error_code_to_exception[code] = (exception_type, domain)
        Logger._domain_codes[domain].add(code)
1275249
def add_codes(err_cls):
    """"""
    class ErrorsWithCodes(object):
        def __getattribute__(self, code):
            msg = getattr(err_cls, code)
            return '[{code}] {msg}'.format(code=code, msg=msg)
    return ErrorsWithCodes()
649773
function buildVerror(code, stdOut, stdErr) {
  return new VError({
    name: stdOut,
    info: {
      code: code,
      stdout: stdOut,
      stderr: stdErr
    }
  }, stdOut + stdErr);
}
610854
def setup_errors(app, error_template="error.html"):
    """"""
    def error_handler(error):
        if isinstance(error, HTTPException):
            description = error.get_description(request.environ)
            code = error.code
            name = error.name
        else:
            description = error
            code = 500
            name = "Internal Server Error"
        return render_template(error_template,
                               error=error,
                               code=code,
                               name=Markup(name),
                               description=Markup(description)), code

    for exception in default_exceptions:
        app.register_error_handler(exception, error_handler)
1146436
function register(codeStart, codeEnd, file) {
    if (codeStart >= codeEnd) {
        throw new Error(`code start value (${codeStart}) must be less than code end value (${codeEnd})`);
    }
    if (sysErrorInited) {
        if (codeStart <= SYS_CODE_END) {
            throw new Error(`code range (${codeStart}~${codeEnd} conflicts with system error codes(${SYS_CODE_START}~${SYS_CODE_END}`);
        }
    }

    let entries = QNodeConfig.load(file, null, false, false);

    for (let key in entries) {
        if (module.exports[key]) throw new Error('duplicated error key: ' + key);

        const formaters = entries[key];
        const code = formaters.code;
        //if (code === 0) throw new Error('code cannot be 0: ' + key);
        if (sysErrorInited && (SYS_CODE_START < code && code < SYS_CODE_END)) {
            throw new Error(`code ${code} conflicts with system error codes(${SYS_CODE_START}~${SYS_CODE_END})`);
        }
        if (ERROR_MAP_BY_CODE[code]) throw new Error('duplicated error code: ' + code);

        const type = { key, code, formaters };

        if (!formaters[BaseError.DEFAULT_LOCALE]) {
            throw new Error(`Error '${code}': missing formater for locale '${BaseError.DEFAULT_LOCALE}'`);
        }

        module.exports[key] = type;
        ERROR_MAP_BY_CODE[code] = type;
    }

    return true;
}
179507
def add_error(self, property_name, message):
    """"""
    if property_name not in self.errors:
      self.errors[property_name] = []
    self.errors[property_name].append(message)
731202
def raise_error(self, status=500, message="Generic server error.  Out of luck..."):
        
        self.set_status(status)
        self.write({"message" : message,
                    "status" : status})
1203134
def _create_error(self, status_code):
        

        return jsend.error(message=ComodoCA.status_code[status_code], code=status_code)
826869
function newError(errorCode, errorMessage) {
		
		var errObj;
		
		if (_.isObject(errorCode)) {
			errObj = errorCode;
		}
		else if (typeof(errorCode) === 'number') {
			errObj = {
				errorCode: errorCode,
			};
			
			if (errorMessage) {
				errObj.message = errorMessage;
			}
		}
		else {
			errObj = {errorCode: 500};
		}
		
		return new Promise(function(resolve, reject) {
			reject(errObj);
		});
	}
315479
def error_code(self, code):
		

		context = {
			'error_title': "Damn error page %i" % code,
			'error_header': "What has happened?",
			'error_footer': "WHY!?!?!",
			'error_messages': {
				('Error %i' % code): self.__message__(code)
			}
		}
		return WWebTemplateResponse(WTemplateText(self.__error_template__()), context=context)
637045
function AddError(message,nopush) {
  if (displayErrors) console.error(message);
  if (!nopush) errors.push(message);
}
559012
def add(self, error):
        
        if not self._path_of_(error):
            self.errors.append(error)
            self.errors.sort()
        else:
            super(ErrorTree, self).add(error)
1268896
def error(message, code=1):
    """"""
    if message:
        print('ERROR: {0}'.format(message), file=sys.stderr)
    else:
        print(file=sys.stderr)
    sys.exit(code)
1185184
def add_error_handler(self, error_input):
        

        if isinstance(error_input, dict):
            error_response = error_input.get('response', {})
            cerr = error_response.get('command_error', NoResponse)
            qerr = error_response.get('query_error', NoResponse)

            response_dict = {'command_error': cerr,
                             'query_error': qerr}

            register_list = error_input.get('status_register', [])

            for register_dict in register_list:
                query = register_dict['q']
                register = StatusRegister(register_dict)
                self._status_registers[to_bytes(query)] = register
                for key in register.keys():
                    self._error_map[key] = register

            queue_list = error_input.get('error_queue', [])

            for queue_dict in queue_list:
                query = queue_dict['q']
                err_queue = ErrorQueue(queue_dict)
                self._error_queues[to_bytes(query)] = err_queue

        else:
            response_dict = {'command_error': error_input,
                             'query_error': error_input}

        for key, value in response_dict.items():
            self._error_response[key] = to_bytes(value)
1288828
def _add(self, error: "Err"):
        
        if self.trace_errs is True:
            self.errors.append(error)
1230909
function error(code, msg) {
    var err = new Error(msg);
    err.errno = code;
    return err;
}
1080353
def error(self, id, errorCode, errorString):
        ''''''
        if errorCode == 165: # Historical data sevice message
            sys.stderr.write("TWS INFO - %s: %s\n" % (errorCode, errorString))
        elif errorCode >= 501 and errorCode < 600: # Socket read failed
            sys.stderr.write("TWS CLIENT-ERROR - %s: %s\n" % (errorCode, errorString))
        elif errorCode >= 100 and errorCode < 1100:
            sys.stderr.write("TWS ERROR - %s: %s\n" % (errorCode, errorString))
        elif errorCode >= 1100 and errorCode < 2100:
            sys.stderr.write("TWS SYSTEM-ERROR - %s: %s\n" % (errorCode, errorString))
        elif errorCode in (2104, 2106, 2108):
            sys.stderr.write("TWS INFO - %s: %s\n" % (errorCode, errorString))
        elif errorCode >= 2100 and errorCode <= 2110:
            sys.stderr.write("TWS WARNING - %s: %s\n" % (errorCode, errorString))
        else:
            sys.stderr.write("TWS ERROR - %s: %s\n" % (errorCode, errorString))