MCPcopy Create free account
hub / github.com/kataras/iris / FallbackViewFunc

Method FallbackViewFunc

context_wrapper.go:204–215  ·  view source on GitHub ↗

FallbackViewFunc same as `Handler` but it converts a handler to FallbackViewFunc.

(handler func(ctx T, err ErrViewNotExist) error)

Source from the content-addressed store, hash-verified

202
203// FallbackViewFunc same as `Handler` but it converts a handler to FallbackViewFunc.
204func (w *ContextWrapper[T]) FallbackViewFunc(handler func(ctx T, err ErrViewNotExist) error) FallbackViewFunc {
205 if handler == nil {
206 return nil
207 }
208
209 return func(ctx Context, err ErrViewNotExist) error {
210 newT := w.pool.Acquire(ctx)
211 returningErr := handler(newT, err)
212 w.pool.Release(newT)
213 return returningErr
214 }
215}

Callers 1

mainFunction · 0.80

Calls 3

AcquireMethod · 0.65
ReleaseMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected