您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Yii2.0抛出异常问题

2024/4/24 23:31:40发布11次查看
try { $model = new resetpasswordform($token);} catch (invalidparamexception $e) { throw new badrequesthttpexception($e->getmessage());}

这是 yii2.0 中的一段代码。
rt,在实际项目开发中,什么情况下需要抛出异常并进行处理?
回复内容: try { $model = new resetpasswordform($token);} catch (invalidparamexception $e) { throw new badrequesthttpexception($e->getmessage());}

这是 yii2.0 中的一段代码。
rt,在实际项目开发中,什么情况下需要抛出异常并进行处理?
比如redis没连接上
try { $redis = new redis();} catch (\exception $e) { var_dump($e->getmessage());}
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product