<?php
/**
 *
 *User:Administrator
 *Date:2021/8/29
 */

namespace app\api\exception;

use Throwable;
//具体的handle方法在app\ExceptionHandle.php 中
class ApiException extends \RuntimeException
{
    public function __construct(array $apiErrCode,Throwable $previous = null)
        //ApiException(config('status.err_user_not_exist')
        //这里array $apiErrCode改成数组是为了方便调用配置文件。config('status.success')
    {
        $code = $apiErrCode[0];
        $message = $apiErrCode[1];
        parent::__construct($message, $code, $previous);
    }
}