I have a yii2 project. I make sending email function on it, so I use yii2 swiftmailer. But I have a problem. Sometimes my connection is bad, so when the function is running my application will stop because the time for sending email is just 30 seconds. So, how can I handle the error exception? May be I can use try-catch, but I don't know how to use it for handle time exception.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):