feat : exception

This commit is contained in:
2024-11-12 11:45:49 +08:00
parent 1fa2e83822
commit 7fbce21622
2 changed files with 7 additions and 1 deletions

View File

@@ -2,9 +2,14 @@
namespace App\Exception; namespace App\Exception;
use App\Constants\ReturnCode;
use Hyperf\Server\Exception\ServerException; use Hyperf\Server\Exception\ServerException;
class ErrException extends ServerException class ErrException extends ServerException
{ {
/**
* 重写抛出错误的状态码
* @var int
*/
protected $code = ReturnCode::ERROR;
} }

View File

@@ -2,6 +2,7 @@
namespace App\Exception\Handler; namespace App\Exception\Handler;
use App\Constants\ReturnCode;
use App\Exception\ErrException; use App\Exception\ErrException;
use App\Lib\AdminReturn; use App\Lib\AdminReturn;
use App\Lib\ApiReturn; use App\Lib\ApiReturn;