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

Method Dispatch

hero/func_result_test.go:91–96  ·  view source on GitHub ↗
(ctx iris.Context)

Source from the content-addressed store, hash-verified

89}
90
91func (e err) Dispatch(ctx iris.Context) {
92 // write the status code based on the err's StatusCode.
93 ctx.StatusCode(e.Status)
94 // send to the client the whole object as json
95 _ = ctx.JSON(e)
96}
97
98func GetCustomErrorAsDispatcher() err {
99 return err{iris.StatusBadRequest, "this is my error as json"}

Callers

nothing calls this directly

Calls 2

StatusCodeMethod · 0.65
JSONMethod · 0.45

Tested by

no test coverage detected