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

Method StopWithPlainError

context/context.go:829–836  ·  view source on GitHub ↗

StopWithPlainError like `StopWithError` but it does NOT write anything to the response writer, it stores the error so any error handler matching the given "statusCode" can handle it by its own.

(statusCode int, err error)

Source from the content-addressed store, hash-verified

827// write anything to the response writer, it stores the error
828// so any error handler matching the given "statusCode" can handle it by its own.
829func (ctx *Context) StopWithPlainError(statusCode int, err error) {
830 if err == nil {
831 return
832 }
833
834 ctx.SetErr(err)
835 ctx.StopWithStatus(statusCode)
836}
837
838// StopWithJSON stops the handlers chain, writes the status code
839// and sends a JSON response.

Callers 5

readBodyHandlerFunction · 0.80
readBodyHandlerFunction · 0.80
NewFunction · 0.80
version.goFile · 0.80

Calls 2

SetErrMethod · 0.95
StopWithStatusMethod · 0.95

Tested by 1