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

Method StopWithProblem

context/context.go:854–858  ·  view source on GitHub ↗

StopWithProblem stops the handlers chain, writes the status code and sends an application/problem+json response. See `iris.NewProblem` to build a "problem" value correctly. If the status code is a failure one then it will also fire the specified error code handler.

(statusCode int, problem Problem)

Source from the content-addressed store, hash-verified

852// If the status code is a failure one then
853// it will also fire the specified error code handler.
854func (ctx *Context) StopWithProblem(statusCode int, problem Problem) error {
855 ctx.StopWithStatus(statusCode)
856 problem.Status(statusCode)
857 return ctx.Problem(problem)
858}
859
860// +------------------------------------------------------------+
861// | Current "user/request" storage |

Callers 2

readBodyFunction · 0.80
postUserFunction · 0.80

Calls 3

StopWithStatusMethod · 0.95
ProblemMethod · 0.95
StatusMethod · 0.80

Tested by

no test coverage detected