yuyue8 / tp_exception
thinkphp exception
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/yuyue8/tp_exception
Requires
- php: >=8.0.2
- topthink/framework: ^6.0 || ^8.0
This package is auto-updated.
Last update: 2025-10-22 10:11:56 UTC
README
安装
composer require yuyue8/tp_exception
使用方法
安装后默认使用 Yuyue8\TpException\basic\BaseException 类为异常处理类
若需要自定义,可以创建自定义异常处理类,继承Yuyue8\TpException\basic\BaseException,
同时在tp_config配置文件中设置base_exception_class参数,值为自定义类
创建异常类:
php think make:exception /app/exception/Admin
使用异常类:
throw new AdminException('错误信息');