error.go 468 B

123456789101112131415161718192021222324
  1. package controllers
  2. import (
  3. "Medical_ERP/common/global"
  4. )
  5. type ErrorController struct {
  6. BaseController
  7. }
  8. func (c *ErrorController) Error404() {
  9. //c.Data["content"] = "page not found"
  10. c.Error(global.PageNotFoundErr, nil, "page not found")
  11. }
  12. func (c *ErrorController) Error500() {
  13. //c.Data["content"] = "server error"
  14. c.Error(global.MsgErr, nil, "server error")
  15. }
  16. func (c *ErrorController) ErrorDb() {
  17. c.Error(global.MsgErr, nil, "database is now down")
  18. }