mirror of
https://github.com/kataras/iris.git
synced 2025-03-14 08:36:28 +01:00
context#ErrEmptyForm
Former-commit-id: c623e7ac433f11c9d89376bee0cd100aa26f35c5
This commit is contained in:
parent
120b5fb635
commit
0f2c5da7df
|
@ -2289,6 +2289,9 @@ var (
|
|||
errReadBody = errors.New("while trying to read %s from the request body. Trace %s")
|
||||
)
|
||||
|
||||
// ErrEmptyForm will be thrown from `context#ReadForm` when empty request data.
|
||||
var ErrEmptyForm = errors.New("form data: empty")
|
||||
|
||||
// ReadForm binds the formObject with the form data
|
||||
// it supports any kind of struct.
|
||||
//
|
||||
|
@ -2296,7 +2299,7 @@ var (
|
|||
func (ctx *context) ReadForm(formObject interface{}) error {
|
||||
values := ctx.FormValues()
|
||||
if values == nil {
|
||||
return errors.New("An empty form passed on ReadForm")
|
||||
return ErrEmptyForm
|
||||
}
|
||||
|
||||
// or dec := formbinder.NewDecoder(&formbinder.DecoderOptions{TagName: "form"})
|
||||
|
|
Loading…
Reference in New Issue
Block a user