-
Notifications
You must be signed in to change notification settings - Fork 119
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
add recover config & default recover handler & tests #681
Conversation
@mstrYoda pls handle this |
I will patch this a few hours later 👍 |
@mstrYoda can you add support for StackTrace like current recover middleware, it might be useful for some cases. |
I pushed the changes, added print stack trace to default recover handler. I did not take any config for recover handler, one can just change it at all including stack handler. |
websocket/websocket.go
Outdated
// Default recover function is used when nil and writes error message in a response field `error` | ||
// It prints stack trace to the stderr by default | ||
// Optional. Default: defaultRecover | ||
Recover func(*Conn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this field be RecoverHandler
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mstrYoda pls change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
fix: #624
As a default behavior I wrote the error as response message. But it can be changed WDYT about it? @efectn