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

HttpDispatcher.responseContent是不是在try中合适? #40

Closed
mujianping opened this issue Mar 26, 2019 · 5 comments · Fixed by #41
Closed

HttpDispatcher.responseContent是不是在try中合适? #40

mujianping opened this issue Mar 26, 2019 · 5 comments · Fixed by #41
Assignees
Labels
question Further information is requested

Comments

@mujianping
Copy link

image

@crossoverJie crossoverJie added the question Further information is requested label Mar 27, 2019
@crossoverJie
Copy link
Member

放在 finally 中可以保证异常时也有响应。

@mujianping
Copy link
Author

放在try里的话,异常时应该走exceptionCaught方法了吧,要不出现异常会不会exceptionCaught和responseContent执行重复 @crossoverJie

@crossoverJie
Copy link
Member

放在try里的话,异常时应该走exceptionCaught方法了吧,要不出现异常会不会exceptionCaught和responseContent执行重复 @crossoverJie

应该是说反了,只有异常时 exceptionCaughtresponseContent 都会执行,但其实问题也不大;

http 是短连接,在 exceptionCaught 做了响应后,responseContent 的响应对之前的响应并没有影响。

不过这里倒确实可以优化下,没必要响应两次。

@mujianping
Copy link
Author

对就这意思,不愧是大jie哥! @crossoverJie

@crossoverJie crossoverJie self-assigned this Jul 9, 2019
crossoverJie added a commit that referenced this issue Jul 11, 2019
fix #40 & add global handle exception interface
@crossoverJie
Copy link
Member

#41 已经优化

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants