创建了多应用api,按照文档https://www.workerman.net/doc/webman/exception.html
创建了,如下图所示的异常捕获,报错。
Error: Wrong parameters for app\api\exception\ApiException([string $message [, long $code [, Throwable $previous = NULL]]]) in D:\Dev\webmanAdmin\webman\vendor\workerman\webman-framework\src\Container.php:70
Stack trace:
#0 D:\Dev\webmanAdmin\webman\vendor\workerman\webman-framework\src\Container.php(70): Exception->__construct(Object(Monolog\Logger), true)
#1 D:\Dev\webmanAdmin\webman\vendor\workerman\webman-framework\src\App.php(259): Webman\Container->make('app\\api\\excepti...', Array)
#2 D:\Dev\webmanAdmin\webman\vendor\workerman\webman-framework\src\App.php(354): Webman\App::exceptionResponse(Object(TypeError), Object(support\Request))
#3 D:\Dev\webmanAdmin\webman\app\middleware\AuthCheck.php(38): Webman\App::Webman\{closure}(Object(support\Request))
#4 D:\Dev\webmanAdmin\webman\vendor\workerman\webman-framework\src\App.php(341): app\middleware\AuthCheck->process(Object(support\Request), Object(Closure))
#5 D:\Dev\webmanAdmin\webman\app\middleware\AccessControl.php(16): Webman\App::Webman\{closure}(Object(support\Request))
#6 D:\Dev\webmanAdmin\webman\vendor\workerman\webman-framework\src\App.php(341): app\middleware\AccessControl->process(Object(support\Request), Object(Closure))
#7 D:\Dev\webmanAdmin\webman\vendor\workerman\webman-framework\src\App.php(168): Webman\App::Webman\{closure}(Object(support\Request))
#8 D:\Dev\webmanAdmin\webman\vendor\workerman\workerman\Connection\TcpConnection.php(646): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#9 D:\Dev\webmanAdmin\webman\vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead(Resource id #422)
#10 D:\Dev\webmanAdmin\webman\vendor\workerman\workerman\Worker.php(1488): Workerman\Events\Select->loop()
#11 D:\Dev\webmanAdmin\webman\vendor\workerman\workerman\Worker.php(1405): Workerman\Worker::forkWorkersForWindows()
#12 D:\Dev\webmanAdmin\webman\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers()
#13 D:\Dev\webmanAdmin\webman\vendor\workerman\webman-framework\src\support\App.php(131): Workerman\Worker::runAll()
#14 D:\Dev\webmanAdmin\webman\start.php(4): support\App::run()
#15 {main}
windows
这里设置的不是具体的异常类,这里设置的是处理异常的类。