<?php
/**
 * Link         :   http://www.phpcorner.net
 * User         :   qingbing<780042175@qq.com>
 * Date         :   2018-10-27
 * Version      :   1.0
 */

namespace Helper;

/**
 * http状态异常类
 * Class Exception
 * @package Helper
 */
class HttpException extends Exception
{
    /**
     * HTTP-STATUS code:400，403, 404, 405, 500, etc.
     * @var int
     */
    public $statusCode;

    /**
     * Constructor.
     * @param int $status HTTP-STATUS code
     * @param string $message
     * @param int $code
     */
    public function __construct($message = '', $status = 200, $code = 0)
    {
        $this->statusCode = $status;
        parent::__construct($message, $code);
    }

    /**
     * 返回异常类型
     * @return string
     */
    public function getName()
    {
        return 'Http Exception';
    }
}