Called when some journals experience an error in some operation.
324360
private void disableAndReportErrorOnJournals(
      List<JournalAndStream> badJournals, String status) throws IOException {
    if (badJournals == null || badJournals.isEmpty()) {
      if (forceJournalCheck) {
        // check status here, because maybe some other operation
        // (e.g., rollEditLog failed and disabled journals) but this
        // was missed by logSync() exit runtime
        forceJournalCheck = false;
        checkJournals(status);
      }
      return; // nothing to do
    }
 
    for (JournalAndStream j : badJournals) {
      LOG.error("Disabling journal " + j);
      j.abort();
      j.setDisabled(true);
      
      // report errors on storage directories as well for FJMs
      if (j.journal instanceof FileJournalManager) {
        FileJournalManager fjm = (FileJournalManager) j.journal;
        // pass image to handle image managers
        storage.reportErrorsOnDirectory(fjm.getStorageDirectory(), image);
      }

      // report error on shared journal/image managers
      if (j.journal instanceof ImageManager) {
        ImageManager im = (ImageManager) j.journal;
        im.setImageDisabled(true);
      }
    }
    // update image manager metrics
    if (image != null) {
      image.updateImageMetrics();
    }
    checkJournals(status);
  }
72460
function(err, model, response, options){
  if (options.cb){
    options.cb(err, model, response);
  }
  if (err){
    model.trigger('error', err, model, options);
  }
}
1084767
void updateJournalMetrics() {
    if (metrics == null) {
      return;
    }
    int failedJournals = 0;
    for(JournalAndStream jas : journals) {
      if(jas.isDisabled()) {
        failedJournals++;
      }
    }
    metrics.journalsFailed.set(failedJournals);
  }
494097
function onOutError(err) {
    errNodecat = combineErrors(errNodecat, err);
    errStream.write(`nodecat: ${err}\n`);
    if (inCleanup) {
      inCleanup();
    }
    allDone();
  }
938594
def _handle_processing_error(err, errstream, client):
    """"""

    errors = sorted(err.events, key=operator.attrgetter("index"))
    failed = [e.event for e in errors]
    silent = all(isinstance(e.error, OutOfOrderError) for e in errors)
    if errstream:
        _deliver_errored_events(errstream, failed)
        must_raise = False
    else:
        must_raise = True
    for _, event, error, tb in errors:
        if isinstance(error, OutOfOrderError):
            # Not really an error: do not log this to Sentry
            continue
        try:
            raise six.reraise(*tb)
        except Exception as err:
            if client:
                client.captureException()
            msg = "{}{}: {}".format(type(err).__name__,
                    err.args, json.dumps(event, indent=4))
            rlogger.error(msg, exc_info=tb)
            if must_raise:
                raise
353094
def _raise_last_error(bulk_write_result):
    
    # Prefer write errors over write concern errors
    write_errors = bulk_write_result.get("writeErrors")
    if write_errors:
        _raise_last_write_error(write_errors)

    _raise_write_concern_error(bulk_write_result["writeConcernErrors"][-1])
1341265
synchronized void reportErrorsOnDirectories(List<StorageDirectory> sds,
      FSImage image) throws IOException {
    for (StorageDirectory sd : sds) {
      reportErrorsOnDirectory(sd, image);
    }
    
    // check image managers (this will update image metrics)
    if (image != null) {
      image.checkImageManagers();
    }
    
    // only check if something was wrong
    if(!sds.isEmpty()) {
      if (this.getNumStorageDirs() == 0)  
        throw new IOException("No more storage directories left");
      
      // check image directories, edits are checked withing FSEditLog.checkJournals
      if (getNumStorageDirs(NameNodeDirType.IMAGE) == 0)
        throw new IOException("No more image storage directories left");
    }
  }
894
def error(self, *args):
        """"""
        if _canShortcutLogging(self.logCategory, ERROR):
            return
        errorObject(self.logObjectName(), self.logCategory,
            *self.logFunction(*args))
367321
private JournalException getUnexpectedEventInArgumentException(String name,
                                                                   String argumentType,
                                                                   String methodName,
                                                                   XMLEvent event) {
        return new JournalException("Unexpected event while processing '"
                + name + "' argument (type = '" + argumentType + "') for '"
                + methodName + "' method call: event is '" + event + "'");
    }
1237642
private void checkForPotentialFilenameConflict() throws JournalException {
        File[] journalFiles =
                MultiFileJournalHelper
                        .getSortedArrayOfJournalFiles(journalDirectory,
                                                      filenamePrefix);
        if (journalFiles.length == 0) {
            return;
        }

        String newestFilename = journalFiles[journalFiles.length - 1].getName();
        String potentialFilename =
                JournalHelper.createTimestampedFilename(filenamePrefix,
                                                        new Date());
        if (newestFilename.compareTo(potentialFilename) > 0) {
            throw new JournalException("The name of one or more existing files in the journal "
                    + "directory (e.g. '"
                    + newestFilename
                    + "') may conflict with new Journal "
                    + "files. Has the system clock changed?");
        }
    }
542517
private void iaddError(String desc, String value, String loc) {
    if (!validate) return;
    ValidationEvent ve = new ValidationEvent(desc, value, loc);
    errors.add(ve);
    correct = false;
  }
491465
def checkAndRaise(pageNum, itemsPerPage):
        
        if pageNum < 1:
            raise ErrPaginationLimits(ErrPaginationLimits.ERR_PAGE_NUM)
        
        if itemsPerPage < Settings.itemsPerPageMin or itemsPerPage > Settings.itemsPerPageMax:
            raise ErrPaginationLimits(ErrPaginationLimits.ERR_ITEMS_PER_PAGE)
89503
function onFailure(err) {
          _removeDOMElement(placeholder);
          if (console && console.debug) {
            console.debug('The following error occured: ', err);
          }

          /* Call custom callback */
          if ($scope.onError) {
            $scope.onError({err:err});
          }

          return;
        }
1133762
def go_to_error(self, text):
        """"""
        match = get_error_match(to_text_string(text))
        if match:
            fname, lnb = match.groups()
            if ("<ipython-input-" in fname and
                    self.run_cell_filename is not None):
                fname = self.run_cell_filename
            self.edit_goto.emit(osp.abspath(fname), int(lnb), '')
127039
def _check_err(code, request_id):
    
    if code == 3006:
        raise CalendarNotExist()
    elif code == 3007:
        raise CalendarOwnByDiffAccount()
    elif code == 3008:
        raise AccountNotExist()
    elif code == 3009 or code == 3013:
        raise AccountUsedByDiffUser()
    elif code == 3010:
        raise InvalidPermissionLevel()
    elif code == 3011:
        raise FailedToClosePublisher()
    elif code == 3014:
        raise InvalidEmail()
    elif code == 3015:
        raise NoAllowedPermission()
    elif code == 3016:
        raise AccountNameEmpty()
    elif code == 3017 or code == 3018:
        raise ErrorCreatingEditor()
    else:
        logging.getLogger(__name__).warn(
            "Unexpected Error Code: %s with %s" % (
                code, request_id))
        raise UnexpectedError()
801575
def perror(*args, **kwargs):
    """"""

    if should_msg(kwargs.get("groups", ["error"])):
        # initialize colorama only if uninitialized
        global colorama_init
        if not colorama_init:
            colorama_init = True
            colorama.init()

        args = indent_text(*args, **kwargs)

        # write to stdout
        sys.stderr.write(colorama.Fore.RED)
        sys.stderr.write("".join(args))
        sys.stderr.write(colorama.Fore.RESET)
        sys.stderr.write("\n")
315176
function recrawlError(error, options, callback) {

      if (options.currentRetries <= options.retries) {
        onRecrawl(error,options, callback);
      }
      else {
        callback();
      }
  }