This commit is contained in:
kataras 2022-06-20 15:31:17 +03:00
parent 9dc356c1d8
commit d1a1dacaff
No known key found for this signature in database
GPG Key ID: 403EEB7885C79503

View File

@ -841,7 +841,7 @@ func (ctx *Context) StopWithPlainError(statusCode int, err error) {
// it will also fire the specified error code handler. // it will also fire the specified error code handler.
func (ctx *Context) StopWithJSON(statusCode int, jsonObject interface{}) error { func (ctx *Context) StopWithJSON(statusCode int, jsonObject interface{}) error {
ctx.StopWithStatus(statusCode) ctx.StopWithStatus(statusCode)
return ctx.writeJSON(jsonObject, nil) // do not modify - see errors.DefaultContextErrorHandler. return ctx.writeJSON(jsonObject, &DefaultJSONOptions) // do not modify - see errors.DefaultContextErrorHandler.
} }
// StopWithProblem stops the handlers chain, writes the status code // StopWithProblem stops the handlers chain, writes the status code