Format error string
@param err  error object
@return String
772782
function (err) {
    var msg = '';
    var t$ = Tool;
    try {
      if (t$.isString(err)) {
        msg = err;
      } else if (t$.isError(err)) {
        msg = err.message;
      } else if (t$.isObject(err)) {
        var errMsg = [];
        for (var p in err) {
          if (err.hasOwnProperty(p)) {
            errMsg.push(p + '=' + err[p]);
          }
        }
        if (errMsg.length === 0) {
          msg = err;
        } else {
          msg = errMsg.join('\n');
        }
      } else {
        msg += '[RTY_CANT_TYPE] = ' + t$.getType(err);
        msg += JSON.stringify(err);
      }
    } catch (error) {
      throw error
    }

    return msg
  }
448865
function formatErrors (results) {
    return ''; 

    var failCount = results.fail.length;
    var past = (failCount === 1) ? 'was' : 'were';
    var plural = (failCount === 1) ? 'failure' : 'failures';

    var out = '\n' + pad(format.red.bold('Failed Tests:') + ' There ' + past + ' ' + format.red.bold(failCount) + ' ' + plural + '\n');
    out += formatFailedAssertions(results);

    return out;
  }
9553
def make_err(self, errtype, message, original, loc, ln=None, reformat=True, *args, **kwargs):
        """"""
        if ln is None:
            ln = self.adjust(lineno(loc, original))
        errstr, index = getline(loc, original), col(loc, original) - 1
        if reformat:
            errstr, index = self.reformat(errstr, index)
        return errtype(message, errstr, index, ln, *args, **kwargs)
566511
function onError(err) {
		// 请求（或响应）发生错误的时候，如果内部任何一层都未能捕获，则在最外层捕获
		Coralian.logger.err("HTTP req error : ");
		Coralian.logger.err(err.code);
		Coralian.logger.err(err.stack);

		// 如果发生 write after end ，则只将错误信息记录到 log 中去
		if (String.contains(err.message, 'write after end')) return;

		req.url = formatString(ERROR_ROUTE_FORMAT, (err.code || HttpStatusCode.INTERNAL_SERVER_ERROR));
		req.parse = url.parse(req.url, true);
		request(req, res);
	}
1103746
function formatSassError(err, data) {
  // Generate three-line preview around the error:
  var preview = data.split('\n');
  preview = preview.slice(Math.max(0, err.line-2), Math.min(err.line+1, preview.length-1));
  preview = preview.map(function(src) { return '>>> '+ src });
  preview.unshift(err.message);

  var error = new Error('Error rendering theme Sass:\n'+ preview.join('\n'));
  error.line = err.line || null;
  error.column = err.column || null;
  return error;
}
265317
function enforce(err) {
    if (is.string(err)) err = new Error(err);
    err.message = err.message.replace(/^Error: /, '');

    return err;
}
1059032
function formatError(e) {
  if (!e.err) return e.message;
  if (e.err.message) return e.err.message;
  return JSON.stringify(e.err);
}
1351851
def format_errors(errors, indent=0, prefix='', suffix=''):
    
    if is_single_item_iterable(errors):
        errors = errors[0]
    if isinstance(errors, SINGULAR_TYPES):
        yield indent_message(repr(errors), indent, prefix=prefix, suffix=suffix)

    elif isinstance(errors, collections.Mapping):
        for key, value in errors.items():
            assert isinstance(key, SINGULAR_TYPES), type(key)
            if isinstance(value, SINGULAR_TYPES):
                message = "{0}: {1}".format(repr(key), repr(value))
                yield indent_message(message, indent, prefix=prefix, suffix=suffix)
            else:
                yield indent_message(repr(key), indent, prefix=prefix, suffix=':')
                for message in format_errors(value, indent + 4, prefix='- '):
                    yield message

    elif is_non_string_iterable(errors):
        # for making the rhs of the numbers line up
        extra_indent = int(math.ceil(math.log10(len(errors)))) + 2
        for index, value in enumerate(errors):
            list_prefix = "{0}. ".format(index)
            messages = format_errors(
                value,
                indent=indent + extra_indent - len(list_prefix),
                prefix=list_prefix,
            )
            for message in messages:
                yield message
    else:
        assert False, "should not be possible"
442313
function(err, data) {
        var regexp = RegExp(/(Z\d)ON/);
        var ret;

        if (data) {
            for (i = 0; i < data.length; i++) {
                if (ret = regexp.exec(data[i])) {
                    zones[ret[1]] = ret[1];
                } else if (data[i] == 'PWON') {
                    zones['ZM'] = 'ZM';
                }
            }
        }
        mdt.telnet('RR?', handleZoneNames);
    }
480393
protected String error2message(IApiError err) {
		if (err != null) {
			StringBuilder sb = new StringBuilder(err.toString());
			if (Str.STR.notNullOrEmpty(err.param())) {
				sb.append(" (").append(err.param()).append(")");
			}
			return sb.toString();
		}
		return new GenericApiError().toString();
	}
1172958
function formatError(e) {
  if (!e.error) {
    return e.message;
  }

  // Don't show stacktrace on informational errors
  if (e.error instanceof Information) {
    return e.error.message;
  }

  // PluginError
  if (typeof e.error.showStack === "boolean") {
    return e.error.toString();
  }
  // Normal error
  if (e.error.stack) {
    return e.error.stack;
  }
  // Unknown (string, number, etc.)
  return new Error(String(e.error)).stack;
}
562673
function(err, req, res, next) {
    err.message = err.message || 'Internal Server Error';
    err.code = err.code || res.code || 500;
    if (!_.isNumber(err.code)) {
      err.code = 500;
    }

    try {
      err.line = err.stack.split('\n')[1].match(/\(.+\)/)[0];
    } catch (e) {
      err.line = null;
    }

    var envelope = {
      meta: {
        code: err.code,
        error: {
          code: err.code,
          message: err.message,
          line: err.line
        }
      },
      data: err.message
    };

    // Set code and data
    res.code = err.code;
    res.data = envelope;

    return next();
  }
404529
def print_err(*args, **kwargs):
    
    sys.stderr.write(" ".join(str(arg) for arg in args) + "\n")
    if kwargs.get("flush", False):
        sys.stderr.flush()
908654
function (err) {
    "use strict";

    var message = '';

    if (typeof err === 'string') {
      return new Error(err);

    } else if (typeof err === 'object') {

      if (err.cause) {
        // probably a webdriver error
        try {
          message = JSON.parse(err.cause.value.message).errorMessage;
        } catch ($) {
          message = err.cause.value.message;
        }
      } else {
        message = err.message || err.toString();
      }
      return new Error(message);
    }
    return new Error(err.toString());
  }
561031
def format_error(e):
    

    if isinstance(e, PyMacaronException):
        return e.to_model()

    if isinstance(e, PyMacaronCoreException) and e.__class__.__name__ == 'ValidationError':
        return ValidationError(str(e)).to_model()

    # Turn this exception into a PyMacaron Error model
    return UnhandledServerError(str(e)).to_model()
257544
function errHandler(err) {
    /* istanbul ignore else */
    if (_output) {
      err = err instanceof Error ? err : new Error(err)
      _emitter.emit('end', err)
      _output = null
    }
    else
      console.error('jspreproc: ' + err)
  }
291101
function formatError (error, input) {
    var message = error.toString().replace(/\s*\(\d*\:\d*\)\s*$/i, ''); // remove line number / col number

    var beforeMatch = ('' + input.slice(0, error.pos)).match(/.*$/i);
    var afterMatch = ('' + input.slice(error.pos)).match(/.*/i);
    var before = beforeMatch ? beforeMatch[0] : '';
    var after = afterMatch ? afterMatch[0] : '';

    // Prepare line info for txt display
    var cursorPos = before.length;
    var errChar = (after.length) ? after.slice(0, 1) : 'X';
    var lineStr = before + after;
    var lncursor = [];
    for (var i = 0; i < lineStr.length; i++) {
        lncursor[i] = (i === cursorPos) ? '^' : '-';
    }
    var lineInfoTxt = lineStr + '\r\n' + lncursor.join('');

    // Prepare line info for HTML display
    var lineInfoHTML = ['<span class="code">', before, '<span class="error" title="', message, '">', errChar, '</span>',
            after.slice(1), '</span>'].join('');

    return {
        description : message,
        lineInfoTxt : lineInfoTxt,
        lineInfoHTML : lineInfoHTML,
        code : lineStr,
        line : error.loc ? error.loc.line : -1,
        column : error.loc ? error.loc.column : -1
    };

}