Skip to content
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

http事件下swoole 与原生Exception 序列化 冲突 #5496

Closed
LIngMax opened this issue Sep 27, 2024 · 1 comment
Closed

http事件下swoole 与原生Exception 序列化 冲突 #5496

LIngMax opened this issue Sep 27, 2024 · 1 comment

Comments

@LIngMax
Copy link

LIngMax commented Sep 27, 2024

Please answer these questions before submitting your issue.

var_dump(serialize(new Exception("fasfasdfad")));#普通环境下执行正常

#http事件下swoole  抛出异常 is not allowed 
$server->on('request', function ($request, $response){serialize(new Exception("fasfasdfad"));@$response->end("啊哈哈哈哈");});


一旦放到 http事件下 马上抛出异常

Serialization of 'Swoole\Http\Request' is not allowed 

swoole扩展不支持序列化的对象  

不可序列化输出警告/不可序列化不输出警告/不可序列化抛出异常

 由开发者控制这样?

  1. What did you do? If possible, provide a simple script for reproducing the error.

Serialization of 'Swoole\Http\Request' is not allowed

  1. What version of Swoole are you using (show your php --ri swoole)?
    5.1.3
@matyhtf
Copy link
Member

matyhtf commented Sep 27, 2024

Exception 带上下文,包含了 Swoole 的资源,不支持序列化。而直接在外面,上下文是空的,可以序列化

@matyhtf matyhtf closed this as completed Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants