mirror of
https://github.com/kataras/iris.git
synced 2025-03-13 21:36:28 +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"))
|
||||
}
|
||||
|
||||
func basicMVC(app *mvc.Application) {
|
||||
// GET: http://localhost:8080
|
||||
app.Handle(new(myController))
|
||||
}
|
||||
|
||||
type myController struct {
|
||||
}
|
||||
|
||||
// overriddes the mvcApp.HandleError function.
|
||||
// func (c *myController) HandleError(ctx iris.Context, err error) {
|
||||
// ctx.HTML(fmt.Sprintf("<i>%s</i>", err.Error()))
|
||||
// }
|
||||
func (c *myController) HandleError(ctx iris.Context, err error) {
|
||||
ctx.HTML(fmt.Sprintf("<i>%s</i>", err.Error()))
|
||||
}
|
||||
|
||||
func (c *myController) Get() error {
|
||||
return fmt.Errorf("error here")
|
||||
|
|
Loading…
Reference in New Issue
Block a user