Skip to content
PHP Ecosystem
Explore

UnprocessableEntityHttpException

API reference › yii › web › UnprocessableEntityHttpException

classyii\web\UnprocessableEntityHttpException
ExtendsHttpException » yii\base\UserException » yii\base\Exception » Exception
Since2.0.7
Sourceframework/web/UnprocessableEntityHttpException.php

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 the server was unable to process the contained instructions. For example, to return form validation errors.

PropertyTypeDescriptionDefined by
$statusCodeintHTTP status code, such as 403, 404, 500, etc. Default: null.HttpException
MethodDescriptionDefined by
__construct()Constructor.UnprocessableEntityHttpException
getName()HttpException
public function __construct(string|null $message = null, int $code = 0, Throwable|null $previous = null)

Constructor.

Parameters

ParameterTypeDescription
$messagestring|nullError message
$codeintError code
$previousThrowable|nullThe previous exception used for the exception chaining.