0 フォロワー

クラス yii\web\ServerErrorHttpException

継承yii\web\ServerErrorHttpException » yii\web\HttpException » yii\base\UserException » yii\base\Exception » Exception
利用可能なバージョン2.0
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/web/ServerErrorHttpException.php

ServerErrorHttpException は、ステータスコード 500 の「Internal Server Error」HTTP 例外を表します。

こちらも参照してください https://tools.ietf.org/html/rfc7231#section-6.6.1.

公開プロパティ

継承されたプロパティを非表示

プロパティ 説明 定義元
$statusCode integer HTTP ステータスコード (例: 403、404、500 など) yii\web\HttpException

公開メソッド

継承されたメソッドを非表示

メソッド 説明 定義元
__construct() コンストラクタ。 yii\web\ServerErrorHttpException
getName() yii\web\HttpException

メソッドの詳細

継承されたメソッドを非表示

__construct() public メソッド

コンストラクタ。

public void __construct ( $message null, $code 0, $previous null )
$message string|null

エラーメッセージ

$code integer

エラーコード

$previous Throwable|null

例外チェーンに使用される前の例外。

                public function __construct($message = null, $code = 0, $previous = null)
{
    parent::__construct(500, $message, $code, $previous);
}

            
getName() public メソッド
public string getName ( )
戻り値 string

この例外のユーザーフレンドリーな名前

                public function getName()
{
    if (isset(Response::$httpStatuses[$this->statusCode])) {
        return Response::$httpStatuses[$this->statusCode];
    }
    return 'Error';
}