Adds an error to the current error list.
@param {String} description the error description
@param {Object} errdesc additional object (block, node, ...) which can contain additional info about the error (line/column number, code).
341261
function (description, errdesc) {

        //TODO: errdesc is a bit vague
        var desc = {
            description : description
        };
        if (errdesc) {
            if (errdesc.line) { // Integers
                desc.line = errdesc.line;
                desc.column = errdesc.column;
            }
            if (errdesc.code) { // String
                desc.code = errdesc.code;
            }
            if (errdesc.suberrors) { // Array of String
                desc.suberrors = errdesc.suberrors;
            }
        }
        this.errors.push(desc);
    }
742391
private void addError(short severity, SAXParseException spex) {
        if (spex.getLineNumber() > 0) {
            buf.append("Line " + spex.getLineNumber() + " - ");
        }
        buf.append(spex.getMessage() + "\n");
        ValidationError error = new ValidationError(severity, buf.toString());
        errors.add(error);
        buf.setLength(0);
    }
162643
function parse_description(str, data) {
        if (data.errors && data.errors.length) { return null; }

        var result = str.match(/^\s+([\s\S]+)?/);

        if (result) {
          return {
            source: result[0],
            data: {description: result[1] === undefined ? '' : result[1].replace(trimNewlineRegex, '')}
          };
        }

        return null;
      }
966096
function makeError(id, msg, err) {
        var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
        if (err) {
            e.originalError = err;
        }
        return e;
    }
498421
function error(err) {
    if (!(err instanceof Error)) return err
    return {
        code: err.code,
        message: err.message,
        details: err.detail,
        stack: err.stack || ''
    }
}
1258170
function _addError(attribute, rule, parameters) {
    if (_errors[attribute]) {
      return;
    };
    _errors[attribute] = _formatMessage(_getMessage(attribute, rule) || '', attribute, rule, parameters);
  }
786304
function formErrorText (info, msg) {
  const hr = '----------'

  return addPlatformInformation(info)
  .then((obj) => {
    const formatted = []

    function add (msg) {
      formatted.push(
        stripIndents(msg)
      )
    }

    add(`
      ${obj.description}

      ${obj.solution}

    `)

    if (msg) {
      add(`
        ${hr}

        ${msg}

      `)
    }

    add(`
      ${hr}

      ${obj.platform}
    `)

    if (obj.footer) {
      add(`

        ${hr}

        ${obj.footer}
      `)
    }

    return formatted.join('\n\n')
  })
}
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;
}
388998
def error_summary(model)
      return nil unless model&.respond_to?(:errors)
      return nil unless model.errors&.any?
      contents = render_alert_message(
          {
              "__The form contains #{model.errors.count} error#{model.errors.count == 1 ? '' : 's'}.__" => model.errors.full_messages
          },
          5
      )

      html = '<div id="error_explanation"><div class="alert alert-danger">' + contents[:text]

      unless contents[:script].blank?
        html += <<-EOS
<script type="text/javascript">
//<![CDATA[
#{contents[:script]}
//]]>
</script>
        EOS
      end

      html += '</div></div>'

      html.html_safe
    end
632887
def error_catcher(self, extra_info: Optional[str] = None):
        
        try:
            yield
        except InstaloaderException as err:
            if extra_info:
                self.error('{}: {}'.format(extra_info, err))
            else:
                self.error('{}'.format(err))
            if self.raise_all_errors:
                raise
137246
function createError(code, details) {
    var error = {
        code: code,
        message: errors.get(code) || "Internal Server Error"
    };

    if (details) error["data"] = details;

    return error;
}
922597
function ErroneousError(e, additional) {
    additional = additional || {};
    this.line = e.lineno || e.lineNumber || additional.lineno;
    this.file = e.filename || e.fileName || additional.filename;
    this.msg = e.message || additional.message;
    this.time = e.timestamp || additional.timestamp || Date.now();
    this.type = (this.parseMessage(this.msg) || e.type || e.name).toLowerCase();

    // If it's a DOM node, let's figure out which
    if (e.target) {
      this.target = this.getTargetIdentifier(e.target);

      if (e.target.nodeName) {
        this.type = 'resource';
        if (e.target.href) {
          this.file = e.target.href;
        } else if (e.target.src) {
          this.file = e.target.src;
        }
      }
    }

    // Parse the stack if any
    this.stack = e.stack;
    this.parseStack(e.stack);
  }
987121
public void debug(Throwable error, String description) {
    log(error, null, description, Level.DEBUG);
  }
1162278
def _get_error(self, code, errors, indentation=0):
        
        # Init
        results = []
        lines = None
        if code is not None:
            lines = [line.strip() for line in code.split('\n')]

        for error in errors.split('\n'):
            # Strip; skip empy lines
            error = error.strip()
            if not error:
                continue
            # Separate line number from description (if we can)
            linenr, error = self._parse_error(error)
            if None in (linenr, lines):
                results.append('%s' % error)
            else:
                results.append('on line %i: %s' % (linenr, error))
                if linenr > 0 and linenr < len(lines):
                    results.append('  %s' % lines[linenr - 1])

        # Add indentation and return
        results = [' ' * indentation + r for r in results]
        return '\n'.join(results)
1327503
def error_add(error)
      message = error
      message = "#{error.class.name}: #{error.message}" if error.is_a?(Exception)
      @state[@server] = { :count => error_count+1, :time => Time.now, :message => message }
    end
589741
public void error(Throwable error, String format, Object... extra) {
    if (shouldLog(INFO)) {
      Log.e(tag, String.format(format, extra), error);
    }
  }
1030043
function(deferred, description, err) {

      // **EVENT:** the `step:error` event is emitted with the step description object and the error message if a step fails.
      this.emit('step:error', description, err);

      // **EVENT:** the `scenario:error` event is emitted with the error message if the scenario is interrupted.
      this.emit('scenario:error', err);

      deferred.reject(err);
    }