(err error)
| 4276 | } |
| 4277 | |
| 4278 | func (ctx *Context) handleContextError(err error) { |
| 4279 | if err == nil { |
| 4280 | return |
| 4281 | } |
| 4282 | |
| 4283 | if errHandler := ctx.app.GetContextErrorHandler(); errHandler != nil { |
| 4284 | errHandler.HandleContextError(ctx, err) |
| 4285 | } else { |
| 4286 | if ctx.IsDebug() { |
| 4287 | ctx.app.Logger().Error(err) |
| 4288 | } |
| 4289 | ctx.StatusCode(http.StatusInternalServerError) |
| 4290 | } |
| 4291 | |
| 4292 | // keep the error non nil so the caller has control over further actions. |
| 4293 | } |
| 4294 | |
| 4295 | // Render writes the response headers and calls the given renderer "r" to render data. |
| 4296 | // This method can be used while migrating from other frameworks. |
no test coverage detected