(ctx iris.Context)
| 89 | } |
| 90 | |
| 91 | func (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 | |
| 98 | func GetCustomErrorAsDispatcher() err { |
| 99 | return err{iris.StatusBadRequest, "this is my error as json"} |
nothing calls this directly
no test coverage detected