mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-18 05:04:51 +08:00
deprecate ZMKnownException
This commit is contained in:
parent
5f4a00c77e
commit
352f3e920e
@ -4,10 +4,21 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZM\Exception;
|
||||
|
||||
use JetBrains\PhpStorm\Deprecated;
|
||||
|
||||
#[Deprecated(reason: '建议使用具体的异常类')]
|
||||
class ZMKnownException extends ZMException
|
||||
{
|
||||
public function __construct($err_code, $message = '', $code = 0, \Throwable $previous = null)
|
||||
{
|
||||
parent::__construct(zm_internal_errcode($err_code) . $message, $code, $previous);
|
||||
if ($err_code === 'E99999') {
|
||||
$code = 0;
|
||||
// 这也太懒了吧
|
||||
} else {
|
||||
// 取最后两数
|
||||
$code = (int)substr($err_code, -2);
|
||||
}
|
||||
parent::__construct($message, '', $code, $previous);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user