我正在使用 Lumen 5.3.*,我需要QueryException
在storage/logs/lumen.log
.
其他验证正在写入日志文件,但QueryException
.
try {
// throw here exception here
} catch (QueryException $e) {
// do what ever
} catch (CustomException $e) {
// do what ever
}
我已经CustomException
扩展\Exception
并使用Handler
类来report()
解释为什么我能够写入日志文件。但是QueryException
没有。(QueryException
是一个流明供应商文件)
我知道有可能只是\Log()
赶上,QueryException
但我想通过不这样说来使事情变得更清洁。
除了执行上述操作之外,还有其他方法可以做到这一点吗?
提前致谢!