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

add recover config & default recover handler & tests #681

Merged
merged 4 commits into from
Jul 23, 2023

Conversation

mstrYoda
Copy link
Member

fix: #624

As a default behavior I wrote the error as response message. But it can be changed WDYT about it? @efectn

@github-actions github-actions bot added the ✏️ Feature New feature or request label Jul 15, 2023
@ReneWerner87
Copy link
Member

@mstrYoda pls handle this
image

@mstrYoda
Copy link
Member Author

@mstrYoda pls handle this

image

I will patch this a few hours later 👍

@efectn
Copy link
Member

efectn commented Jul 16, 2023

@mstrYoda can you add support for StackTrace like current recover middleware, it might be useful for some cases.

@mstrYoda
Copy link
Member Author

@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.

// 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)
Copy link
Member

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mstrYoda pls change this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

@efectn efectn requested a review from gaby July 20, 2023 18:11
@ReneWerner87 ReneWerner87 merged commit 8de95d9 into gofiber:main Jul 23, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: Websocket middleware is not compatible with Recover middleware
3 participants