MCPcopy
hub / github.com/gofiber/fiber / returnBindErr

Method returnBindErr

bind.go:182–191  ·  view source on GitHub ↗

returnBindErr runs returnErr and, if the result is not a *Error, wraps it in *BindError. Use for binding parse failures; use returnErr directly for Custom and validation errors.

(err error, source string)

Source from the content-addressed store, hash-verified

180// returnBindErr runs returnErr and, if the result is not a *Error, wraps it in *BindError.
181// Use for binding parse failures; use returnErr directly for Custom and validation errors.
182func (b *Bind) returnBindErr(err error, source string) error {
183 if retErr := b.returnErr(err); retErr != nil {
184 var fiberErr *Error
185 if errors.As(retErr, &fiberErr) && fiberErr != nil {
186 return fiberErr
187 }
188 return newBindError(source, retErr)
189 }
190 return nil
191}
192
193// Struct validation.
194func (b *Bind) validateStruct(out any) error {

Callers 13

CustomMethod · 0.95
HeaderMethod · 0.95
RespHeaderMethod · 0.95
CookieMethod · 0.95
QueryMethod · 0.95
JSONMethod · 0.95
CBORMethod · 0.95
XMLMethod · 0.95
FormMethod · 0.95
URIMethod · 0.95
MsgPackMethod · 0.95
BodyMethod · 0.95

Calls 2

returnErrMethod · 0.95
newBindErrorFunction · 0.85

Tested by 1