NotFoundOrError responses with 404 page for not found error and 500 page otherwise.
(err error, msg string)
| 182 | |
| 183 | // NotFoundOrError responses with 404 page for not found error and 500 page otherwise. |
| 184 | func (c *Context) NotFoundOrError(err error, msg string) { |
| 185 | if errutil.IsNotFound(err) { |
| 186 | c.NotFound() |
| 187 | return |
| 188 | } |
| 189 | c.Error(err, msg) |
| 190 | } |
| 191 | |
| 192 | // NotFoundOrErrorf is same as NotFoundOrError but with formatted message. |
| 193 | func (c *Context) NotFoundOrErrorf(err error, format string, args ...any) { |
no test coverage detected