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)
| 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. |
| 182 | func (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. |
| 194 | func (b *Bind) validateStruct(out any) error { |