mirror of
https://github.com/kataras/iris.git
synced 2026-02-28 05:26:00 +00:00
fix #1531 and introduce the 'Configuration.ResetOnFireErrorCode' (read HISTORY.md)
Former-commit-id: 84f1e894378a6dfd94e0bf057f4037e35aee0c4f
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
* [Route State](routing/route-state/main.go)
|
||||
* [Reverse Routing](routing/reverse/main.go)
|
||||
* [Router Wrapper](routing/custom-wrapper/main.go)
|
||||
* [Custom Router](routing/custom-high-level-router/main.go)
|
||||
* [Custom Router](routing/custom-router/main.go)
|
||||
* Custom Context
|
||||
* [Method Overriding](routing/custom-context/method-overriding/main.go)
|
||||
* [New Implementation](routing/custom-context/new-implementation/main.go)
|
||||
|
||||
@@ -61,7 +61,7 @@ func (b *Bootstrapper) SetupWebsockets(endpoint string, handler websocket.ConnHa
|
||||
}
|
||||
|
||||
// SetupErrorHandlers prepares the http error handlers
|
||||
// `(context.StatusCodeNotSuccessful`, which defaults to < 200 || >= 400 but you can change it).
|
||||
// `(context.StatusCodeNotSuccessful`, which defaults to >=400 (but you can change it).
|
||||
func (b *Bootstrapper) SetupErrorHandlers() {
|
||||
b.OnAnyErrorCode(func(ctx iris.Context) {
|
||||
err := iris.Map{
|
||||
|
||||
@@ -72,7 +72,7 @@ func (r *customRouter) RouteExists(ctx iris.Context, method, path string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *customRouter) FireErrorCode(ctx iris.Context) {
|
||||
func (r *customRouter) FireErrorCode(ctx iris.Context, reset bool) {
|
||||
// responseStatusCode := ctx.GetStatusCode() // set by prior ctx.StatusCode calls
|
||||
// [...]
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/kataras/iris/v12/_examples/response-writer/herotemplate/template"
|
||||
"github.com/kataras/iris/v12/_examples/view/herotemplate/template"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris/v12/_examples/response-writer/quicktemplate/templates"
|
||||
"github.com/kataras/iris/v12/_examples/view/quicktemplate/templates"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris/v12/_examples/response-writer/quicktemplate/templates"
|
||||
"github.com/kataras/iris/v12/_examples/view/quicktemplate/templates"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris/v12/_examples/response-writer/quicktemplate/templates"
|
||||
"github.com/kataras/iris/v12/_examples/view/quicktemplate/templates"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris/v12/_examples/response-writer/quicktemplate/controllers"
|
||||
"github.com/kataras/iris/v12/_examples/view/quicktemplate/controllers"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user