【发布时间】:2016-05-17 21:12:45
【问题描述】:
最近移到 php7.出现以下错误:
argument 1 passed to MyClass\Throwable::exceptionHandler() must be an instance of Exception, instance of Error given
以及相应的类
namespace MyClass;
class Throwable
{
public function exceptionHandler(\Exception $exception)
{
//logic here
}
}
如docs中所述
现在大多数错误都是通过抛出错误异常来报告的。
这是否意味着我必须向异常处理程序提供Error 或更一般的Throwable 的实例?
【问题讨论】:
标签: php error-handling exception-handling