mirror of
https://github.com/kataras/iris.git
synced 2025-03-15 05:26:26 +01:00
clean up the mvc error handler example
Former-commit-id: 30e42fe0a6c39909739ec6423d75a2be0fe4f1f6
This commit is contained in:
parent
0d4d2bd3fa
commit
7df7f0fea2
|
@ -26,18 +26,13 @@ func main() {
|
||||||
app.Run(iris.Addr(":8080"))
|
app.Run(iris.Addr(":8080"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func basicMVC(app *mvc.Application) {
|
|
||||||
// GET: http://localhost:8080
|
|
||||||
app.Handle(new(myController))
|
|
||||||
}
|
|
||||||
|
|
||||||
type myController struct {
|
type myController struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// overriddes the mvcApp.HandleError function.
|
// overriddes the mvcApp.HandleError function.
|
||||||
// func (c *myController) HandleError(ctx iris.Context, err error) {
|
func (c *myController) HandleError(ctx iris.Context, err error) {
|
||||||
// ctx.HTML(fmt.Sprintf("<i>%s</i>", err.Error()))
|
ctx.HTML(fmt.Sprintf("<i>%s</i>", err.Error()))
|
||||||
// }
|
}
|
||||||
|
|
||||||
func (c *myController) Get() error {
|
func (c *myController) Get() error {
|
||||||
return fmt.Errorf("error here")
|
return fmt.Errorf("error here")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user