mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
error handlers per party: log those routes too and all test cases paased
need cleanup though Former-commit-id: 6b0c18e38b58af2388015c7cf1af9cc43d7d35d3
This commit is contained in:
@@ -39,11 +39,17 @@ func MakeHandler(tmpl macro.Template) context.Handler {
|
||||
|
||||
return func(ctx context.Context) {
|
||||
if !filter(ctx) {
|
||||
ctx.StopExecution()
|
||||
if ctx.GetCurrentRoute().StatusErrorCode() == ctx.GetStatusCode() {
|
||||
ctx.Next()
|
||||
} else {
|
||||
ctx.StopExecution()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// if all passed, just continue.
|
||||
// if all passed or the next is the registered error handler to handle this status code,
|
||||
// just continue.
|
||||
ctx.Next()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user