mirror of
https://github.com/kataras/iris.git
synced 2026-03-06 08:25:59 +00:00
HandleHTTPError MVC Method as requested at #1595. Read HISTORY.md
example at: https://github.com/kataras/iris/tree/master/_examples/mvc/error-handler-http
This commit is contained in:
@@ -155,6 +155,7 @@ Prior to this version the `iris.Context` was the only one dependency that has be
|
||||
| [time.Time](https://golang.org/pkg/time/#Time) | `time.Now()` |
|
||||
| [*golog.Logger](https://pkg.go.dev/github.com/kataras/golog) | Iris Logger |
|
||||
| [net.IP](https://golang.org/pkg/net/#IP) | `net.ParseIP(ctx.RemoteAddr())` |
|
||||
| [mvc.Code](https://pkg.go.dev/github.com/kataras/iris/v12/mvc?tab=doc#Code) | `ctx.GetStatusCode()` |
|
||||
| `string`, | |
|
||||
| `int, int8, int16, int32, int64`, | |
|
||||
| `uint, uint8, uint16, uint32, uint64`, | |
|
||||
@@ -362,6 +363,10 @@ Response:
|
||||
|
||||
Other Improvements:
|
||||
|
||||
- New `Controller.HandleHTTPError(mvc.Code) <T>` optional Controller method to handle http errors as requested at: [MVC - More Elegent OnErrorCode registration?](https://github.com/kataras/iris/issues/1595). Example can be found [here](https://github.com/kataras/iris/tree/master/_examples/mvc/error-handler-http/main.go).
|
||||
|
||||

|
||||
|
||||
- New [Rewrite Engine Middleware](https://github.com/kataras/iris/tree/master/middleware/rewrite). Set up redirection rules for path patterns using the syntax we all know. [Example Code](https://github.com/kataras/iris/tree/master/_examples/routing/rewrite).
|
||||
|
||||
```yml
|
||||
|
||||
Reference in New Issue
Block a user