书接上文
Laravel ->Exceptions ->Handler-> render错误异常的封装_丿灬安之若死-CSDN博客
<?php
/**
* @Description
* @Date 2021-12-21 05:24
*/
namespace Modules\Common\Exceptions;
use Exception;
use Throwable;
class ApiException extends Exception
{
public function __construct($message = "", $code = 0, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
// public function __construct(array $error_array, Throwable $previous = null)
// {
// parent::__construct($error_array['message'], $error_array['code'], $previous);
// }
}
throw new ApiException("服务器错误", 5000);