Error renders the 500 page.
(err error, msg string)
| 164 | |
| 165 | // Error renders the 500 page. |
| 166 | func (c *Context) Error(err error, msg string) { |
| 167 | log.ErrorDepth(4, "%s: %v", msg, err) |
| 168 | |
| 169 | c.Title("status.internal_server_error") |
| 170 | |
| 171 | // Only in non-production mode or admin can see the actual error message. |
| 172 | if !conf.IsProdMode() || (c.IsLogged && c.User.IsAdmin) { |
| 173 | c.Data["ErrorMsg"] = err |
| 174 | } |
| 175 | c.HTML(http.StatusInternalServerError, fmt.Sprintf("status/%d", http.StatusInternalServerError)) |
| 176 | } |
| 177 | |
| 178 | // Errorf renders the 500 response with formatted message. |
| 179 | func (c *Context) Errorf(err error, format string, args ...any) { |
no test coverage detected