Merge branch '2103' of https://github.com/janfrs/yii2 into janfrs-2103

This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
Alexander Makarov
2015-09-27 10:42:58 +03:00
gitea-unlock(16/)
octicon-diff(16/tw-mr-1) 2 changed files with 36 additions and 0 deletions

1
framework/CHANGELOG.md
View File

@@ -18,6 +18,7 @@ Yii Framework 2 Change Log
- Bug #9754: Fixed `yii\web\Request` error when path info is empty (dynasource)
- Chg #9369: `Yii::$app->user->can()` now returns `false` instead of erroring in case `authManager` component is not configured (creocoder)
- Chg #9411: `DetailView` now automatically sets container tag ID in case it's not specified (samdark)
- Enh #2106: Added Unprocessable Entity Http Exception (janfrs)
- Enh #9635: Added default CSS class for `\yii\grid\ActionColumn` header (arogachev, dynasource)
- Enh #9711: Added `yii\widgets\LinkPager::$pageCssClass` that allows to set default page class (ShNURoK42)

35
framework/web/UnprocessableEntityHttpException.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\web;
/**
* UnprocessableEntityHttpException represents an "Unprocessable Entity" HTTP
* exception with status code 422.
*
* Use this exception to inform that the server understands the content type of
* the request entity and the syntax of that request entity is correct but server
* was unable to process the contained instructions. For example, to return form
* validation errors.
*
* @link http://www.webdav.org/specs/rfc2518.html#STATUS_422
* @author Jan Silva <janfrs3@gmail.com>
* @since 2.0.7
*/
class UnprocessedEntityHttpException extends HttpException
{
/**
* Constructor.
* @param string $message error message
* @param integer $code error code
* @param \Exception $previous The previous exception used for the exception chaining.
*/
public function __construct($message = null, $code = 0, \Exception $previous = null)
{
parent::__construct(422, $message, $code, $previous);
}
}