-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] 当有多个异常处理器时,对象注入失败 #9
Labels
bug
Something isn't working
Comments
handle 里不能什么都不返回。。。 handle 方法体里 加上以下代码试试
|
This was referenced Aug 28, 2019
This was referenced Dec 6, 2019
Closed
Closed
Closed
Closed
Closed
This was referenced Sep 18, 2020
Closed
Closed
Closed
Closed
Closed
This was referenced Apr 26, 2022
Closed
kingIZZZY
added a commit
to kingIZZZY/hyperf
that referenced
this issue
Jan 18, 2023
Not sure what the correct fix should be... other PDO drivers might have `exec` method, but [Swoole\Coroutine\PostgreSQL does not](https://github.com/swoole/swoole-src/blob/master/ext-src/swoole_postgresql_coro.cc#L396) ```log [ERROR] Error: Call to undefined method Swoole\Coroutine\PostgreSQL::exec() in /opt/www/vendor/hyperf/database/src/Connection.php:390 Stack trace: #0 /opt/www/vendor/hyperf/database/src/Connection.php(1054): Hyperf\Database\Connection->Hyperf\Database\{closure}() hyperf#1 /opt/www/vendor/hyperf/database/src/Connection.php(1018): Hyperf\Database\Connection->runQueryCallback() hyperf#2 /opt/www/vendor/hyperf/database/src/Connection.php(394): Hyperf\Database\Connection->run() hyperf#3 /opt/www/vendor/hyperf/db-connection/src/Connection.php(48): Hyperf\Database\Connection->unprepared() hyperf#4 /opt/www/vendor/hyperf/db-connection/src/Traits/DbConnection.php(76): Hyperf\DbConnection\Connection->__call() hyperf#5 /opt/www/vendor/hyperf/db-connection/src/Db.php(66): Hyperf\DbConnection\Connection->unprepared() hyperf#6 /opt/www/migrations/2023_01_18_181219_create_scrape_log_table.php(24): Hyperf\DbConnection\Db::__callStatic() hyperf#7 /opt/www/vendor/hyperf/database/src/Migrations/Migrator.php(451): CreateScrapeLogTable->up() hyperf#8 /opt/www/vendor/hyperf/database-pgsql/src/Concerns/PostgreSqlSwooleExtManagesTransactions.php(34): Hyperf\Database\Migrations\Migrator->Hyperf\Database\Migrations\{closure}() hyperf#9 /opt/www/vendor/hyperf/db-connection/src/Connection.php(48): Hyperf\Database\PgSQL\PostgreSqlSwooleExtConnection->transaction() hyperf#10 /opt/www/vendor/hyperf/db-connection/src/Traits/DbConnection.php(86): Hyperf\DbConnection\Connection->__call() hyperf#11 /opt/www/vendor/hyperf/database/src/Migrations/Migrator.php(459): Hyperf\DbConnection\Connection->transaction() hyperf#12 /opt/www/vendor/hyperf/database/src/Migrations/Migrator.php(327): Hyperf\Database\Migrations\Migrator->runMigration() hyperf#13 /opt/www/vendor/hyperf/database/src/Migrations/Migrator.php(114): Hyperf\Database\Migrations\Migrator->runUp() hyperf#14 /opt/www/vendor/hyperf/database/src/Migrations/Migrator.php(80): Hyperf\Database\Migrations\Migrator->runPending() hyperf#15 /opt/www/vendor/hyperf/database/src/Commands/Migrations/MigrateCommand.php(48): Hyperf\Database\Migrations\Migrator->run() hyperf#16 /opt/www/vendor/hyperf/command/src/Command.php(423): Hyperf\Database\Commands\Migrations\MigrateCommand->handle() hyperf#17 [internal function]: Hyperf\Command\Command->Hyperf\Command\{closure}() hyperf#18 {main}``` A few other calls in the source to consider: - hyperf/database/src/Concerns/ManagesTransactions.php - https://github.com/hyperf/hyperf/blob/master/src/database/src/Concerns/ManagesTransactions.php#L182 - https://github.com/hyperf/hyperf/blob/master/src/database/src/Concerns/ManagesTransactions.php#L215 - hyperf/database-pgsql/src/Concerns/PostgreSqlSwooleExtManagesTransactions.php - https://github.com/hyperf/hyperf/blob/master/src/database-pgsql/src/Concerns/PostgreSqlSwooleExtManagesTransactions.php#L182 - https://github.com/hyperf/hyperf/blob/master/src/database-pgsql/src/Concerns/PostgreSqlSwooleExtManagesTransactions.php#L215
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(php -v)
7.2.18(php --ri swoole)
4.3.5Description:
当有多个异常处理器时,异常处理器中handle方法注入失败。
Steps To Reproduce:
新增异常处理器,app/Exception/Handler/OrderExceptionHandler.php
注册异常处理器
控制器诱发异常
控制台显示注入异常
![image](https://user-images.githubusercontent.com/3809601/59906147-92989d00-943a-11e9-8c8d-5c23d3331327.png)
The text was updated successfully, but these errors were encountered: