MAPs will return the appropriate error code.
519516
function getISOCurrency($curr) {
    $out = "";
    if(ctype_digit($curr) || is_int($curr)) {
      $numCurr = $curr + 0;
      if($numCurr < 10) {
        $out = "00" . $numCurr;
      } else if ($numCurr < 100) {
        $out = "0" . $numCurr;
      } else {
        //Assume 3 digits (if greater let MAPs handle error)
        $out = "" . $numCurr;
      }
    } else {
      // Convert char to digit
      $curCode = Array();
      $curCode["AUD"]="036";
      $curCode["CAD"]="124";
      $curCode["CHF"]="756";
      $curCode["CZK"]="203";
      $curCode["DKK"]="208";
      $curCode["EUR"]="978";
      $curCode["GBP"]="826";
      $curCode["HUF"]="348";
      $curCode["JPY"]="392";
      $curCode["NOK"]="578";
      $curCode["NZD"]="554";
      $curCode["PLN"]="985";
      $curCode["SEK"]="752";
      $curCode["SGD"]="702";
      $curCode["USD"]="840";
      $out = $curCode[$curr];
    }

    return $out;
  }
961157
private static ModelAndView paramError(Map<String, String> paramErrors, Map<String, Object[]> paramArgusErrors,
                                           ErrorCode errorCode) {

        JsonObjectBase jsonObject = JsonObjectUtils.buildFieldError(paramErrors, paramArgusErrors, errorCode);
        return JsonObjectUtils.JsonObjectError2ModelView((JsonObjectError) jsonObject);
    }
1057425
function (res, errorCode, errorMessage) {
    res.writeHead(errorCode, {"Content-Type": "text/html"});
    //Read the local error file
    return fs.readFile(options.error, "utf8", function (error, content) {
        //Check the error
        if (error) {
            return res.end("<" + "h1>Error</h1><p>" + errorMessage + "</p>");
        }
        let data = {code: errorCode, message: errorMessage};
        content = content.replace(/{{([^{}]+)}}/g, function(match, found)
            {
                found = found.trim();
                if(typeof data[found] !== "undefined") {
                    return data[found].toString();
                } else {
                    return match;
                }
            });
        return res.end(content);
    });
}
967144
def getErrorCorrectMapping(cell_barcodes, whitelist, threshold=1):
    ''' '''

    true_to_false = collections.defaultdict(set)

    whitelist = set([str(x).encode("utf-8") for x in whitelist])

    for cell_barcode in cell_barcodes:
        match = None
        barcode_in_bytes = str(cell_barcode).encode("utf-8")
        for white_cell in whitelist:

            if barcode_in_bytes in whitelist:  # don't check if whitelisted
                continue

            if edit_distance(barcode_in_bytes, white_cell) <= threshold:
                if match is not None:  # already matched one barcode
                    match = None  # set match back to None
                    break  # break and don't add to maps
                else:
                    match = white_cell.decode("utf-8")

        if match is not None:
            true_to_false[match].add(cell_barcode)

    return true_to_false
192256
private static boolean mySqlErrorCodeMatches(Exception e, int errorCode)
    {
        return Throwables.getCausalChain(e).stream()
                .filter(SQLException.class::isInstance)
                .map(SQLException.class::cast)
                .filter(t -> t.getErrorCode() == errorCode)
                .map(Throwable::getStackTrace)
                .anyMatch(isMySQLException());
    }
695719
function tryPackErrorKeys(object, results) {
            if (object instanceof Error) {
                results.push(packValue("message"), packValue("stack"));
                return true;
            }
        }
447233
def handle_errors(resp):
    """"""
    if resp.status_code == 400:
        raise ApiException(json.loads(resp.content).get('message'))
    return resp
698103
def _error_repr(error):
    """"""
    error_repr = repr(error)
    if len(error_repr) > 200:
        error_repr = hash(type(error))
    return error_repr
935662
def from_response(response):
        '''
        
        '''
        cls = PLAID_ERROR_TYPE_MAP.get(response['error_type'], PlaidError)
        return cls(response['error_message'],
                   response['error_type'],
                   response['error_code'],
                   response['display_message'],
                   response['request_id'],
                   response.get('causes'))
1242966
def _errcheck(result, func, arguments):
    

    if result != 0:
        raise XdoException(
            'Function {0} returned error code {1}'
            .format(func.__name__, result))
    return None
618284
public void info(Throwable error, Map<String, Object> custom) {
    info(error, custom, null);
  }
1135211
public java.util.Map<java.lang.String, alluxio.grpc.InconsistentProperties> getErrorsMap() {
    return internalGetErrors().getMap();
  }
924396
def validate(cls, code, prefix):
        '''
        
        '''
        reasons = []

        pieces = code.split('-')
        n = len(pieces)
        if n > 3:
            reasons.append('{}invalid geo code "{}"'.format(prefix, code))
        elif n > 0 and pieces[0] not in geo_data:
            reasons.append('{}unknown continent code "{}"'
                           .format(prefix, code))
        elif n > 1 and pieces[1] not in geo_data[pieces[0]]:
            reasons.append('{}unknown country code "{}"'.format(prefix, code))
        elif n > 2 and \
                pieces[2] not in geo_data[pieces[0]][pieces[1]]['provinces']:
            reasons.append('{}unknown province code "{}"'.format(prefix, code))

        return reasons
1258226
function _getListedError (cartoError, errorList) {
  var errorListkeys = _.keys(errorList);
  var key;
  for (var i = 0; i < errorListkeys.length; i++) {
    key = errorListkeys[i];
    if (!(errorList[key].messageRegex instanceof RegExp)) {
      throw new Error('MessageRegex on ' + key + ' is not a RegExp.');
    }
    if (errorList[key].messageRegex.test(cartoError.message)) {
      return {
        friendlyMessage: _replaceRegex(cartoError, errorList[key]),
        errorCode: _buildErrorCode(cartoError, key)
      };
    }
  }

  // When cartoError not found return generic values
  return {
    friendlyMessage: cartoError.message || '',
    errorCode: _buildErrorCode(cartoError, 'unknown-error')
  };
}
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)
1326823
function onError( error ) {
		debug( 'Error encountered while querying endpoint: %s', error.message );
		if ( error instanceof Error ) {
			err = {
				'status': 500,
				'message': 'Request error: ' + error.message
			};
			return clbk( err );
		}
		return clbk( error, res, body );
	}
1358909
def get_error(response):
    """"""

    errors = {
        400: BadRequestError,
        401: UnauthorizedError,
        403: AccessDeniedError,
        404: NotFoundError,
        429: RateLimitExceededError,
        500: ServerError,
        502: BadGatewayError,
        503: ServiceUnavailableError
    }

    error_class = HTTPError
    if response.status_code in errors:
        error_class = errors[response.status_code]

    return error_class(response)