2019-12-15 13:38:02 +08:00
|
|
|
<?php
|
2019-12-15 13:38:47 +08:00
|
|
|
namespace catcher\exceptions;
|
|
|
|
|
2019-12-22 09:37:52 +08:00
|
|
|
use Exception;
|
|
|
|
use think\exception\HttpException;
|
|
|
|
|
|
|
|
abstract class CatchException extends HttpException
|
|
|
|
{
|
|
|
|
protected const HTTP_SUCCESS = 200;
|
|
|
|
|
|
|
|
public function __construct(string $message = '', int $code = 0, Exception $previous = null, array $headers = [], $statusCode = 0)
|
|
|
|
{
|
2020-01-06 17:08:10 +08:00
|
|
|
parent::__construct($statusCode, $message ? : $this->getMessage(), $previous, $headers, $code);
|
2019-12-22 09:37:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getStatusCode()
|
|
|
|
{
|
|
|
|
return self::HTTP_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|