mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 13:05:56 +00:00
new simple _examples/README.md, wiki should live only inside kataras/iris/wiki and the provided e-book
Former-commit-id: 350eafb0f70f8433e394e103ff93fa332ee00a05
This commit is contained in:
@@ -54,7 +54,7 @@ func defaultResultHandler(ctx context.Context, v interface{}) error {
|
||||
// All types that complete this interface
|
||||
// can be returned as values from the method functions.
|
||||
//
|
||||
// Example at: https://github.com/kataras/iris/tree/master/_examples/hero/overview.
|
||||
// Example at: https://github.com/kataras/iris/tree/master/_examples/dependency-injection/overview.
|
||||
type Result interface {
|
||||
// Dispatch should send a response to the client.
|
||||
Dispatch(context.Context)
|
||||
@@ -436,7 +436,7 @@ func (r Response) Dispatch(ctx context.Context) {
|
||||
// wraps the template file name, layout, (any) view data, status code and error.
|
||||
// It's smart enough to complete the request and send the correct response to the client.
|
||||
//
|
||||
// Example at: https://github.com/kataras/iris/blob/master/_examples/hero/overview/web/routes/hello.go.
|
||||
// Example at: https://github.com/kataras/iris/blob/master/_examples/dependency-injection/overview/web/routes/hello.go.
|
||||
type View struct {
|
||||
Name string
|
||||
Layout string
|
||||
|
||||
@@ -103,6 +103,13 @@ func makeHandler(fn interface{}, c *Container, paramsCount int) context.Handler
|
||||
return
|
||||
}
|
||||
|
||||
// If ~an error status code is set or~ execution has stopped
|
||||
// from within the dependency (something went wrong while validating the request),
|
||||
// then stop everything and let handler fire that status code.
|
||||
if ctx.IsStopped() /* || context.StatusCodeNotSuccessful(ctx.GetStatusCode())*/ {
|
||||
return
|
||||
}
|
||||
|
||||
inputs[binding.Input.Index] = input
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user