1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 09:57:01 +00:00

add Context.SetJSONOptions

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-03-31 20:47:01 +03:00
parent cf36063adf
commit 84d1a60334
3 changed files with 55 additions and 9 deletions

View File

@@ -248,7 +248,7 @@ type Error struct {
}
// Error method completes the error interface. It just returns the canonical name, status code, message and details.
func (err Error) Error() string {
func (err *Error) Error() string {
if err.Message == "" {
err.Message = "<empty>"
}
@@ -312,6 +312,6 @@ func fail(ctx *context.Context, codeName ErrorCodeName, msg, details string, val
Validation: validationErrors,
}
// ctx.SetErr(err)
// ctx.SetErr(&err)
ctx.StopWithJSON(errorCode.Status, err)
}