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

Recover middleware: Added, fiber.Ctx as a first paremeter to StackTra… #1623

Merged

Conversation

turgayozgur
Copy link
Contributor

Please provide enough information so that others can review your pull request:

Added, fiber.Ctx as a first paremeter of the recover middleware StackTraceHandler.

Explain the details for making this change. What existing problem does the pull request solve?

Adding a fiber.Ctx as a parameter of StackTraceHandler function allow us to set stack trace string to c.Locals(). So, we will be able to log the stack trace on the ErrorHandler instead of putting that log twice for the stack trace.

@welcome
Copy link

welcome bot commented Nov 14, 2021

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@ReneWerner87
Copy link
Member

thx, please also add a PR for our docs repository
https://github.com/gofiber/docs/blob/master/api/middleware/recover.md

@turgayozgur
Copy link
Contributor Author

gofiber/docs#216

@hi019
Copy link
Contributor

hi019 commented Nov 17, 2021

Wouldn't this be a breaking change? Maybe we could create a new method like StackTraceHandlerWithContext

@ReneWerner87
Copy link
Member

Yes, should be a breaking change, would mention that in the release notes and refrain from using another method as it will only affect a few

@ReneWerner87 ReneWerner87 merged commit c9e959c into gofiber:master Nov 29, 2021
@welcome
Copy link

welcome bot commented Nov 29, 2021

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants