TimeoutErrorWithCode sets response body to msg and response status code to statusCode. All response modifications after TimeoutErrorWithCode call are ignored. TimeoutErrorWithCode MUST be called before returning from RequestHandler if there are references to ctx and/or its members in other gorouti
(msg string, statusCode int)
| 1685 | // Usage of this function is discouraged. Prefer eliminating ctx references |
| 1686 | // from pending goroutines instead of using this function. |
| 1687 | func (ctx *RequestCtx) TimeoutErrorWithCode(msg string, statusCode int) { |
| 1688 | var resp Response |
| 1689 | resp.SetStatusCode(statusCode) |
| 1690 | resp.SetBodyString(msg) |
| 1691 | ctx.TimeoutErrorWithResponse(&resp) |
| 1692 | } |
| 1693 | |
| 1694 | // TimeoutErrorWithResponse marks the ctx as timed out and sends the given |
| 1695 | // response to the client. |