In case of an error during transform, determine if it should be logged
to the console and/or printed in the source.
169237
function createTransformError(error: any): string {
  if (error instanceof RelayTransformError) {
    return `Relay Transform Error: ${error.message}`;
  }

  const {sourceText, validationErrors} = error;
  if (validationErrors && sourceText) {
    const sourceLines = sourceText.split('\n');
    return validationErrors
      .map(({message, locations}) => {
        return (
          'GraphQL Validation Error: ' +
          message +
          '\n' +
          locations
            .map(location => {
              const preview = sourceLines[location.line - 1];
              return (
                preview &&
                [
                  '>',
                  '> ' + preview,
                  '> ' + ' '.repeat(location.column - 1) + '^^^',
                ].join('\n')
              );
            })
            .filter(Boolean)
            .join('\n')
        );
      })
      .join('\n');
  }

  return util.format(
    'Relay Transform Error: %s\n\n%s',
    error.message,
    error.stack,
  );
}
971597
private void checkNeededValues(TransformationDescription description) {
        String message = "The TransformationDescription doesn't contain a %s. Description loading aborted";
        if (description.getSourceModel().getModelClassName() == null) {
            throw new IllegalArgumentException(String.format(message, "source class"));
        }
        if (description.getTargetModel().getModelClassName() == null) {
            throw new IllegalArgumentException(String.format(message, "target class"));
        }
        String message2 = "The version string of the %s is not a correct version string. Description loading aborted";
        try {
            Version.parseVersion(description.getSourceModel().getVersionString());
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException(String.format(message2, "source class"), e);            
        }
        try {
            Version.parseVersion(description.getTargetModel().getVersionString());
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException(String.format(message2, "target class"), e);            
        }
    }
998397
def is_error(self):
        
        try:
            if self._task.is_alive():
                if len(self._task.stderr.readlines()) > 0:
                    self._task.join()
                    self._write_log()
                    return True
        except AttributeError:
            pass
        return False
52347
@Override
    public boolean shouldPrintLoggingErrors() {
        return CONFIGURATION.getBooleanProperty(
                NETFLIX_BLITZ4J_PRINT_LOGGING_ERRORS,
                Boolean.valueOf(this.getPropertyValue(
                        NETFLIX_BLITZ4J_PRINT_LOGGING_ERRORS, "false"))).get();
    }
1051008
@Override
    public void notifyTransformed(Transformable transformable)
    {
        updater.notifyTransformed(origin, this, transformable, collisions, cacheRectRender);
    }
603152
private void validateRecordedMapping() {
    if (currentMapping.destinationMutators == null || currentMapping.destinationMutators.isEmpty())
      errors.missingDestination();
    // If mapping a field without a source
    else if (options.skipType == 0
        && (currentMapping.sourceAccessors == null || currentMapping.sourceAccessors.isEmpty())
        && currentMapping.destinationMutators.get(currentMapping.destinationMutators.size() - 1)
            .getPropertyType()
            .equals(PropertyType.FIELD) && options.converter == null && !options.mapFromSource
        && sourceConstant == null)
      errors.missingSource();
    else if (options.skipType == 2 && options.condition != null)
      errors.conditionalSkipWithoutSource();
  }
336569
def process_source(source)
      if source == "00"
        logger.warn("Connection has been aborted by the service provider because of an error by the service user (client side).")
      elsif source == "02"
        logger.warn("Connection has been aborted by the service provider because of an error by the service provider (server side).")
      else
        logger.warn("Connection has been aborted by the service provider, with an unknown cause of the problems. (error code: #{source})")
      end
    end
1006709
def errorprint():
    """"""
    try:
        yield

    except ConfigurationError as e:
        click.secho('%s' % e, err=True, fg='red')
        sys.exit(1)
491141
function _check($from_lines, $to_lines)
    {
        if (serialize($from_lines) != serialize($this->getOriginal())) {
            trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
        }
        if (serialize($to_lines) != serialize($this->getFinal())) {
            trigger_error("Reconstructed final doesn't match", E_USER_ERROR);
        }

        $rev = $this->reverse();
        if (serialize($to_lines) != serialize($rev->getOriginal())) {
            trigger_error("Reversed original doesn't match", E_USER_ERROR);
        }
        if (serialize($from_lines) != serialize($rev->getFinal())) {
            trigger_error("Reversed final doesn't match", E_USER_ERROR);
        }

        $prevtype = null;
        foreach ($this->_edits as $edit) {
            if ($prevtype == get_class($edit)) {
                trigger_error("Edit sequence is non-optimal", E_USER_ERROR);
            }
            $prevtype = get_class($edit);
        }

        return true;
    }
658108
private void printRawError(int pos, String msg) {
        if (source == null || pos == Position.NOPOS) {
            printRawLines(errWriter, "error: " + msg);
        } else {
            int line = source.getLineNumber(pos);
            JavaFileObject file = source.getFile();
            if (file != null)
                printRawLines(errWriter,
                           file.getName() + ":" +
                           line + ": " + msg);
            printErrLine(pos, errWriter);
        }
        errWriter.flush();
    }
1336687
def _check_y_exog(self, y, exog, null_allowed=False):
        """"""
        y, exog = super(BaseExogTransformer, self)._check_y_exog(y, exog)
        if exog is None and not null_allowed:
            raise ValueError("exog must be non-None for exogenous "
                             "transformers")
        return y, exog
902632
function printStack(err) {
  if (err && err.stack) {
    console.error(err.stack);
  }
  else {
    console.log(err);
  }
}
62411
function callback(err, hasError) {

    if (err !== null) {
        console.log(chalk.red('Error running JSHint over project: %j\n'), err);
    }

    if (hasError) {
        console.log(chalk.blue('\nSummary\n=======\n'));
        for (var errorCode in errors) {
            if (errors.hasOwnProperty(errorCode)) {
                displaySummary(errorCode);
            }
        }

        console.log('');

        if (totalErrors > 1) {
            console.log(chalk.red('Found %d errors.\n'), totalErrors);
        } else {
            console.log(chalk.red('Found 1 error.\n'));
        }
    } else {
        console.log(chalk.green('No JSHint errors found.\n'));
    }
}
141594
protected void onTransformerErrorOccurred(Source failedObject, Exception exception) {

        for (TransformerEventListener listener : transformerEventListeners)
            fireErrorEvent(listener, new TransformerErrorEvent(this, failedObject, exception));
    }

    /**
     * (Re)-fires a preconstructed event.
     * @param event The event to fire
     */
    protected void onTransformerErrorOccurred(TransformerErrorEvent event) {

        for (TransformerEventListener listener : transformerEventListeners)
            fireErrorEvent(listener, event);
    }

    /**
     * Fires the given event on the given listener.
     * @param listener The listener to fire the event to.
     * @param event The event to fire.
     */
    private void fireErrorEvent(TransformerEventListener listener, TransformerErrorEvent event) {

        try {
            listener.ErrorOccurred(event);
        }
        catch (RuntimeException e) {
            // Log this somehow
            System.err.println("Exception thrown while trying to invoke event listener, removing bed behaved listener.");
            e.printStackTrace();
            removeTransformerEventListener(listener);
        }
    }
1111053
function _transform() {
	var codeIn = $('#codeIn').val();
	try {
		var codeOut = Streamline.transform(codeIn, {
			runtime: _generators ? "generators" : "callbacks",
		});
		$('#codeOut').val(codeOut);
		info("ready");
	} catch (ex) {
		console.error(ex);
		error(ex.message);
	}
}
114226
function handleError(e, done) {
    if(this.defaultValue) return done(null, this.defaultValue);
    if(this[defaultError]) return done(this[defaultError]);
    done(e);
  }
918344
def msg(cls, error=None, debug=True, trace=True):
        
        if debug and error is not None:
            print(error)
        # TODO: BUG: trace should only be printed if debug is true
        if trace:
            print(traceback.format_exc())