Error handling is one of the most important aspects in a web application design because it helps in two ways. Firstly, it lets the application user know in a relatively friendly manner that something has gone wrong and they should contact the technical support department or someone from tech support should be notified. Secondly, it allows the programmer to put in some niceties to aid in the debugging of issues. In this recipe, we will learn how we can implement error handling in Beego.
Handling HTTP errors in Beego
How to do it...
- Move to $GOPATH/src/my-first-beego-project/controllers and create errorcontroller.go, where we will define handlers to handle 404 and 500 HTTP errors as well as the handler to handle any generic...