-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Handler Errors #127
Handler Errors #127
Conversation
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. |
@@ -176,7 +176,9 @@ func (app *Application) handler(fctx *fasthttp.RequestCtx) { | |||
// Set route pointer if user wants to call .Route() | |||
ctx.route = route | |||
// Execute handler with context | |||
route.Handler(ctx) | |||
if err := route.Handler(ctx); err != nil { |
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.
SA9003: empty branch (from staticcheck
)
@@ -192,7 +194,9 @@ func (app *Application) handler(fctx *fasthttp.RequestCtx) { | |||
if route.Midware && strings.HasPrefix(path, route.Path) { | |||
found = true | |||
ctx.route = route | |||
route.Handler(ctx) | |||
if err := route.Handler(ctx); err != nil { |
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.
SA9003: empty branch (from staticcheck
)
@@ -227,7 +231,9 @@ func (app *Application) handler(fctx *fasthttp.RequestCtx) { | |||
ctx.route = route | |||
|
|||
// Execute handler with context | |||
route.Handler(ctx) | |||
if err := route.Handler(ctx); err != nil { |
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.
SA9003: empty branch (from staticcheck
)
Thanks for your PR, but we had a different API in mind see #128 |
Based on #126, I have added the error to the handler syntax, but it has empty logic for handling errors.