mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
clean up the mvc error handler example
Former-commit-id: 30e42fe0a6c39909739ec6423d75a2be0fe4f1f6
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user