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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摑 [Proposal]: Upgrade fiber.NewError() for error handle #3040

Open
3 tasks done
pwtitle opened this issue Jun 24, 2024 · 2 comments
Open
3 tasks done

馃摑 [Proposal]: Upgrade fiber.NewError() for error handle #3040

pwtitle opened this issue Jun 24, 2024 · 2 comments

Comments

@pwtitle
Copy link

pwtitle commented Jun 24, 2024

Feature Proposal Description

i want use Custom ErrorHandler to handle my error, but now fiber.NewError() has missed my message params

for example i want use fiber.NewError like this:

return fiber.NewError(45001, "my error message", 401)

on fiber.NewError() will missed my params : 401

image

can you change the Error and NewError() like this:

image

i will handle the error in my Custom ErrorHandler:

image

Alignment with Express API

nothing

HTTP RFC Standards Compliance

nothing

API Stability

nothing

Feature Examples

nothing

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have searched for existing issues that describe my proposal before opening this one.
  • I understand that a proposal that does not meet these guidelines may be closed without explanation.
Copy link

welcome bot commented Jun 24, 2024

Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@ReneWerner87
Copy link
Member

@pwtitle hi, i think you have a very specific problem that does not match the requirements of other consumers

the fiber.Error struct is public and you can fill it without the NewError method

@gaby gaby changed the title 馃摑 [Proposal]: upgrade firber.NewError() for error handle 馃摑 [Proposal]: Upgrade fiber.NewError() for error handle Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants