php - set_error_handler,捕获所有返回错误的函数
问题描述
我有一个自定义异常类。
而且我已经将我的错误处理程序设置为调用一个自定义的包罗万象的函数,然后它会抛出一个错误。
class customError extends exception {}
function catchall($number, $message, $file, $line) {
throw new customError($number, $message, 0, $file, $line);
}
set_error_handler('catchall', -1 & ~E_NOTICE & ~E_USER_NOTICE);
我收到以下错误:Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])
解决方案
推荐阅读
- html - SVG按钮内的文本?
- python - Does pytest support multiprocessing.set_start_method?
- reactjs - Nested React Router Component Won't Render on New Page
- android - 用于切换按钮的 SQLite 动态 where 子句
- curl - cURL 'server certificate status verification SKIPPED'
- python - 如何使用 asyncio 和 concurrent.futures.ProcessPoolExecutor 在 Python 中终止长时间运行的计算(CPU 绑定任务)?
- pandas - 在 Panda 中读取文件列表时出现循环错误
- function - 似乎无法在 powershell 中使用多个参数执行 Function.Invoke?
- javascript - 变量 javascript 的快照
- python - 使用谷歌云存储“附件”