Render validation errors.
517273
function validate(res, result) {
  if (!result) return true;

  var err = new Error('Validation failed');
  try {
    err.errors = result.errors();
  } catch (err) {
    err.errors = [result.validation];
  }
  err.expose = true;
  err.statusCode = 400;
  err.toJSON = function() {
    return {
      message: this.message,
      errors: this.errors,
    };
  };

  res.sf.reply(err);
}
549860
public void validate(final List<Throwable> validationErrors) {
        if (this.matchers == null) {
            validationErrors.add(new IllegalArgumentException(
                    "Matchers cannot be null.  There should be at least a !acceptAll matcher"));
        }
        if (this.matchers != null && this.matchers.isEmpty()) {
            validationErrors.add(new IllegalArgumentException(
                    "There are no url matchers defined.  There should be at least a " +
                            "!acceptAll matcher"));
        }
    }
884613
def print_validation_errors(result):
    
    click.echo(red('\nValidation failed:'))
    click.echo(red('-' * 40))
    messages = result.get_messages()
    for property in messages.keys():
        click.echo(yellow(property + ':'))
        for error in messages[property]:
            click.echo(red('* ' + error))
        click.echo('')
81920
protected function renderError() {	
	    $error = I18N::translate('The media file was not found in this family tree.');

    	$width  = (mb_strlen($error) * 6.5 + 50) * 1.15;
    	$height = 60;
    	$im     = imagecreatetruecolor($width, $height); /* Create a black image */
    	$bgc    = imagecolorallocate($im, 255, 255, 255); /* set background color */
    	imagefilledrectangle($im, 2, 2, $width - 4, $height - 4, $bgc); /* create a rectangle, leaving 2 px border */
    
    	$this->embedText($im, $error, 100, '255, 0, 0', WT_ROOT . Config::FONT_DEJAVU_SANS_TTF, 'top', 'left');
    
    	http_response_code(404);
    	header('Content-Type: image/png');
    	imagepng($im);
    	imagedestroy($im);
	}
1146373
private void executeValidate(FacesContext context) {
        try {
            validate(context);
        } catch (RuntimeException e) {
            context.renderResponse();
            throw e;
        }

        if (!isValid()) {
            context.validationFailed();
            context.renderResponse();
        }
    }
226727
public void validate()
    {
        Dimension size = desktopPane.getSize();
        size.height -= computeDesktopIconsSpace();
        layoutInternalFrames(size);
    }
1090918
function(errors) {	
		var i,k;
		if(YAHOO.lang.isArray(errors)) {
			for(i = 0 ; i < errors.length ; i++) {
				k = errors[i][0];
				value = errors[i][1];
				if(this.inputsNames[k]) {
					if(this.inputsNames[k].options.showMsg) {
						this.inputsNames[k].displayMessage(value);
						Dom.replaceClass(this.inputsNames[k].divEl, "inputEx-valid", "inputEx-invalid" );
					}
				}
			}
		}
		else if(YAHOO.lang.isObject(errors)) {
			for(k in errors) {
				if(errors.hasOwnProperty(k)) {
					if(this.inputsNames[k]) {
						if(this.inputsNames[k].options.showMsg) {
							this.inputsNames[k].displayMessage(errors[k]);
							Dom.replaceClass(this.inputsNames[k].divEl, "inputEx-valid", "inputEx-invalid" );
						}
					}
				}
			}
		}
	}
1313042
function renderSummary(totalErrors, totalWarnings) {
  var totalProblems = totalErrors + totalWarnings;
  var renderedText = totalProblems + ' ' + pluralize('problem', totalProblems);

  if (totalProblems !== 0) {
    renderedText += ' (' + totalErrors + ' ' + pluralize('error', totalErrors) + ', ' + totalWarnings + ' ' + pluralize('warning', totalWarnings) + ')';
  }
  return renderedText;
}
228721
function (rule) {
    var msg = this.messages.render(rule);
    this.errors.add(rule.attribute, msg);
    this.errorCount++;
  }
1002351
private function registerErrorRenderer()
    {
        if ($this->kernel()->isCli()) {
            $this->container()->bind(ErrorRendererContract::class, ConsoleErrorRenderer::class);
        } else {
            $this->container()->bind(ErrorRendererContract::class, HttpErrorRenderer::class);
        }
    }
600168
def invalid(cls, data, context=None):
        """"""
        return cls(cls.TagType.INVALID, data, context)
355633
def _validate(self, data):
        """"""

        errors = {}

        # if the validator is not enabled, return the empty error dict
        if not self._enabled:
            return errors

        for field in self.validators:

            field_errors = []

            for validator in self.validators[field]:
                try:
                    validator(data.get(field, None))
                except ValidationError as e:
                    field_errors += e.messages

            # if there were errors, cast to ErrorList for output convenience
            if field_errors:
                errors[field] = ErrorList(field_errors)

        return errors
670130
public function RenderErrors () {
		/** @var $this \MvcCore\Ext\Forms\IField */
		$result = "";
		if (
			$this->errors && 
			$this->form->GetErrorsRenderMode() !== \MvcCore\Ext\Forms\IForm::ERROR_RENDER_MODE_ALL_TOGETHER
		) {
			$result .= '<span class="errors">';
			foreach ($this->errors as $key => $errorMessage) {
				$errorCssClass = 'error error-' . $this->name . ' error-' . $key;
				$result .= "<span class=\"$errorCssClass\">$errorMessage</span>";
			}
			$result .= '</span>';
		}
		return $result;
	}
639447
protected function validateRenderer()
    {
        if ($this->renderer === null) {
            $settingsInstance = $this->getSettingsInstance();

            if ($this->type === static::TYPE_EXCEL) {
                $writerClasses = $settingsInstance->getDefaultExcelWriterClasses();
                $rendererClass = $settingsInstance->getDefaultExcelRendererClass();
            } elseif ($this->type === static::TYPE_PDF) {
                $writerClasses = $settingsInstance->getDefaultPDFWriterClasses();
                $rendererClass = $settingsInstance->getDefaultPDFRendererClass();
            } else {
                $writerClasses = $settingsInstance->getDefaultWriterClasses();
                $rendererClass = $settingsInstance->getDefaultRendererClass();
            }

            $writerInstances = [];
            foreach ($writerClasses as $writerClass) {
                $writerInstances[] = new $writerClass();
            }

            $this->renderer = new $rendererClass($writerInstances);
        }
    }
474921
def render_revalidation_failure(self, step, form, **kwargs):
        
        self.storage.current_step = step
        return self.render(form, **kwargs)
728490
public function dontSeeFormErrors()
    {
        $viewErrorBag = $this->app->make('view')->shared('errors');

        $this->assertEquals(0, count($viewErrorBag), 'Expecting that the form does not have errors, but there were!');
    }
710900
function renderIssue(message) {
	return issueTemplate({
		severity: severityString(message.severity),
		severityName: message.severity === 1 ? 'Warning' : 'Error',
		lineNumber: message.line,
		column: message.column,
		message: message.message,
		ruleId: message.ruleId,
		ruleLink: getRuleLink(message.ruleId)
	});
}