【发布时间】:2013-02-07 22:27:12
【问题描述】:
当我执行我的脚本时出现问题并引发异常,但不是停止所有脚本。如何告诉 zend 继续?
当我获取邮件时出现此错误我有一个 try catch 块但它没有捕获。
Fatal error: Uncaught exception 'Zend\Mail\Exception\RuntimeException' with message 'Line "X-Assp-Message/IP-Score:
谢谢。
我的代码是一个获取邮件的简单类:
$listm = new Zend\Mail\Storage\Pop3(array('host' => $this->mServer,'user' => $this->mMail, 'password' => $this->mPassword));
foreach ($listm as $msgp3)
{
try
{
e($msgp3->from);
e($msgp3->to);
e($msgp3->subject);
e($msgp3->date);
e(strtotime($msgp3->date));
e($msgp3->messageid);
} catch (Exception $e) {
e($e->getMessage());
}
}
而我的代码在 10em 邮件处停止,那么如何让 Zend 不停止呢?
【问题讨论】:
-
如果你能贴出你的代码会更好看。
-
"我有一个 try catch 块,但它没有捕获。" - 那么你做错了什么。
标签: php zend-framework exception uncaught-exception