1
0
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:
Gerasimos (Makis) Maropoulos
2020-05-11 11:11:27 +03:00
parent c039730521
commit ad74d7b935
6 changed files with 71 additions and 44 deletions

View File

@@ -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()
}
}