今天看着视频敲代码,但是我就是报错:代码内容如下:
namespace app\lib\exception;
use think\Exception;
use think\exception\Handle;
class ExceptionHandle extends Handle
{
/**
* @param Exception $ex
* @return \think\Response|\think\response\Json
*/
public function render(Exception $ex)
{
return json('~~~~~~~');
}
}上面有一段 use think\Exception;如果改成 use \Exception; 就不报错,不知道什么原因,求大佬们帮忙解惑
最佳答案