mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
add x/errors.RecoveryHandler
This commit is contained in:
@@ -3,7 +3,7 @@ package errors
|
||||
import "github.com/kataras/iris/v12/context"
|
||||
|
||||
// DefaultContextErrorHandler returns a context error handler
|
||||
// which fires a JSON bad request (400) error message when
|
||||
// which calls the HandleError on any incoming error when
|
||||
// a rich rest response failed to be written to the client.
|
||||
// Register it on Application.SetContextErrorHandler method.
|
||||
var DefaultContextErrorHandler context.ErrorHandler = new(jsonErrorHandler)
|
||||
@@ -13,5 +13,5 @@ type jsonErrorHandler struct{}
|
||||
// HandleContextError completes the context.ErrorHandler interface. It's fired on
|
||||
// rich rest response failures.
|
||||
func (e *jsonErrorHandler) HandleContextError(ctx *context.Context, err error) {
|
||||
InvalidArgument.Err(ctx, err)
|
||||
HandleError(ctx, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user