StopWithPlainError like `StopWithError` but it does NOT write anything to the response writer, it stores the error so any error handler matching the given "statusCode" can handle it by its own.
(statusCode int, err error)
| 827 | // write anything to the response writer, it stores the error |
| 828 | // so any error handler matching the given "statusCode" can handle it by its own. |
| 829 | func (ctx *Context) StopWithPlainError(statusCode int, err error) { |
| 830 | if err == nil { |
| 831 | return |
| 832 | } |
| 833 | |
| 834 | ctx.SetErr(err) |
| 835 | ctx.StopWithStatus(statusCode) |
| 836 | } |
| 837 | |
| 838 | // StopWithJSON stops the handlers chain, writes the status code |
| 839 | // and sends a JSON response. |