public static function unprocessableEntity(array $errors, $message = '', $previous = NULL) { $e = new self($message, 422, $previous); $e->errors = $errors; return $e; }
private function validateNewPassword($password) { try { Security\Passwords::validateNew($password); return true; } catch (Nette\UnexpectedValueException $ex) { throw BadRequestException::unprocessableEntity(array($ex->getMessage), 'Bad format of new password.'); } }