set_error_handler,捕获所有函数返回错误

I have a custom exception class.

And I've set my error handler to call a custom catchall function, which would then throw an error.

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);

I get the following error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])