mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
add mvc.Err builtin dependency to map any context/mvc response's.Err field on methods like HandleHTTPError
relative to: https://github.com/kataras/iris/issues/1606
This commit is contained in:
@@ -20,7 +20,20 @@ type (
|
||||
ErrorHandlerFunc func(*context.Context, error)
|
||||
|
||||
// Code is a special type for status code.
|
||||
// It's used for a builtin dependency to map the status code given by a previous
|
||||
// method or middleware.
|
||||
// Use a type like that in order to not conflict with any developer-registered
|
||||
// dependencies.
|
||||
// Alternatively: ctx.GetStatusCode().
|
||||
Code int
|
||||
|
||||
// Err is a special type for error stored in mvc responses or context.
|
||||
// It's used for a builtin dependency to map the error given by a previous
|
||||
// method or middleware.
|
||||
// Use a type like that in order to not conflict with any developer-registered
|
||||
// dependencies.
|
||||
// Alternatively: ctx.GetErr().
|
||||
Err error
|
||||
)
|
||||
|
||||
// HandleError fires when a non-nil error returns from a request-scoped dependency at serve-time or the handler itself.
|
||||
|
||||
Reference in New Issue
Block a user