1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 13:05:56 +00:00

add a new _proposals folder and a silly idea

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-04-10 01:08:11 +03:00
parent 60bf26eab8
commit b0ccd579af
3 changed files with 94 additions and 5 deletions

View File

@@ -3793,10 +3793,18 @@ type JSON struct {
ErrorHandler ErrorHandler
}
// ErrorHandler describes a context error handler. As for today this is only used
// to globally or per-party or per-route handle JSON writes error.
type ErrorHandler interface {
HandleContextError(ctx *Context, err error)
type (
// ErrorHandler describes a context error handler. As for today this is only used
// to globally or per-party or per-route handle JSON writes error.
ErrorHandler interface {
HandleContextError(ctx *Context, err error)
}
// ErrorHandlerFunc a function shortcut for ErrorHandler interface.
ErrorHandlerFunc func(ctx *Context, err error)
)
func (h ErrorHandlerFunc) HandleContextError(ctx *Context, err error) {
h(ctx, err)
}
// IsDefault reports whether this JSON options structure holds the default values.