Helper to return a collection of errors for the given job
6493
def collection_for_job(cls, job):
        
        return cls.collection(job_model_repr=job.get_model_repr(), identifier=getattr(job, '_cached_identifier', job.identifier.hget()))
859737
def execution_errors(self):
        
        if self.split_actions:
            # throttling split this action, get errors from the split
            return [dict(e) for s in self.split_actions for e in s.errors]
        else:
            return [dict(e) for e in self.errors]
1256061
def _get_errors(self):
        
        errors = self.json.get('data').get('failures')
        if errors:
            logger.error(errors)
        return errors
744134
def get_error_summary(job):
    
    cache_key = 'error-summary-{}'.format(job.id)
    cached_error_summary = cache.get(cache_key)
    if cached_error_summary is not None:
        return cached_error_summary

    # don't cache or do anything if we have no text log errors to get
    # results for
    errors = TextLogError.objects.filter(step__job=job)
    if not errors:
        return []

    # cache terms generated from error line to save excessive querying
    term_cache = {}

    error_summary = [bug_suggestions_line(err, term_cache) for err in errors]
    cache.set(cache_key, error_summary, BUG_SUGGESTION_CACHE_TIMEOUT)

    return error_summary
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
  }
760995
function showLoadingErrors() {
  const failedTasks = []
  const taskStatus = {}

  // Construct data for full report
  for (const data of scripts) {
    const messages = []
    // check sources
    const mSources = data.sources.filter(s => glob.sync(s).length === 0)
    if (mSources.length !== 0) {
      messages.push(
        `✘ Missing sources: ${(mSources.length > 1 ? '\n  ' : '') +
          mSources.map(s => `'${s}'`).join('\n  ')}`
      )
    }
    // display remaining errors
    for (const error of data.errors) {
      let msg = error.message || error.toString()
      const prefix = msg.startsWith('Error') ? '' : 'Error: '
      messages.push(`✘ ${prefix}${msg.replace(/\n/g, '\n  ')}`)
    }
    if (messages.length > 0) {
      failedTasks.push(data.name)
    } else {
      messages.push(`✔ No issues detected`)
    }
    taskStatus[data.name] = messages
  }

  if (failedTasks.length !== 0) {
    const messages = []
    for (const key of Object.keys(taskStatus)) {
      messages.push(
        `${key}:\n  ${taskStatus[key].join('\n').replace(/\n/g, '\n  ')}`
      )
    }

    showError(
      new Error(
        `${failedTasks.length > 1 ? 'Errors' : 'Error'} in ${failedTasks
          .map(s => `'${s}'`)
          .join(', ')}\n${messages.join('\n')}`
      )
    )
  }
}
589573
function getResult (err) {
        var res = {
            valid: true,
            errors: []
        };

        if (err !== null) {
            res.valid = false;
            res.errors.push(err);
        }

        return res;
    }
1121101
def error_handler(task):
    """"""
    @wraps(task)
    def wrapper(self, *args, **kwargs):
        try:
            return task(self, *args, **kwargs)
        except Exception as e:
            self.connected = False
            if not self.testing:
                exc_type, exc_obj, exc_tb = sys.exc_info()
                fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
                error_message = (
                    "[" + str(datetime.now()) + "] Error in task \"" +
                    task.__name__ + "\" (" +
                    fname + "/" + str(exc_tb.tb_lineno) +
                    ")" + e.message
                )
                self.logger.error("%s: RPC instruction failed" % error_message)
    return wrapper
132100
function transformAjvErrors(errors = []) {
  if (errors === null) {
    return [];
  }

  return errors.map(e => {
    const { dataPath, keyword, message, params, schemaPath } = e;
    let property = `${dataPath}`;

    // put data in expected format
    return {
      name: keyword,
      property,
      message,
      params, // specific to ajv
      stack: `${property} ${message}`.trim(),
      schemaPath,
    };
  });
}
564149
def get_errors(self):
        
        result = []
        while not self.errors.empty():  # pragma: no cover
            try:
                e = self.errors.get(False)
                result.append(e)
            except self.errors.Empty:
                continue
            self.errors.task_done()
        return result
690680
function getErrorMessage(errors) {
  if (_.isArray(errors)) {
    return _.uniq(_.pluck(errors, 'stack')).join().replace(/instance./g, '');
  } else if (errors) {
    return errors.message;
  }
}
1253347
function yankError(callback) {
  return function (err, results) {
    if (err || (results[0] && results[0].error)) {
      callback(err || results[0]);
    } else {
      callback(null, results.length ? results[0]  : results);
    }
  };
}
1318223
function _parseErrors() {
    let errors = [].slice.call(arguments);
    let parsed = [];

    errors.forEach(err => {
        let message = (err instanceof Error) ? err.stack : err.toString();
        parsed.push(message);
    });

    return parsed;
}
167711
def onerror(self, message, source, lineno, colno):
        """"""
        return (message, source, lineno, colno)
970737
def get_failed_job(self, id):
        
        url = self._url('{}/errors'.format(id))
        return self.client.get(url)
290814
private static JavaScriptObject[] toNativeErrorArray(List<JSError> errors) {
    JavaScriptObject[] out = new JavaScriptObject[errors.size()];
    for (int i = 0; i < errors.size(); ++i) {
      JSError error = errors.get(i);
      DiagnosticType type = error.getType();
      out[i] = createError(error.sourceName, error.description, type != null ? type.key : null,
          error.lineNumber, error.getCharno());
    }
    return out;
  }
282952
def return_an_error(*args):
    '''
    '''
    list_errors = []
    list_errors.extend(list(args))

    errors = { 'errors': list_errors }
    return errors