MCPcopy Create free account
hub / github.com/kataras/iris / handleContextError

Method handleContextError

context/context.go:4278–4293  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

4276}
4277
4278func (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.

Callers 9

RenderComponentMethod · 0.95
JSONMethod · 0.95
JSONPMethod · 0.95
XMLMethod · 0.95
MarkdownMethod · 0.95
YAMLMethod · 0.95
TextYAMLMethod · 0.95
ProtobufMethod · 0.95
MsgPackMethod · 0.95

Calls 6

IsDebugMethod · 0.95
StatusCodeMethod · 0.95
HandleContextErrorMethod · 0.65
ErrorMethod · 0.65
LoggerMethod · 0.65

Tested by

no test coverage detected