mirror of
https://github.com/kataras/iris.git
synced 2025-03-14 08:16:28 +01:00
context#ErrEmptyForm
Former-commit-id: 92db200ae1dc08dbdb7b345d4299941d248747f0
This commit is contained in:
parent
6fc7fc632a
commit
dd8f06d950
|
@ -2414,6 +2414,9 @@ var (
|
||||||
errReadBody = errors.New("while trying to read %s from the request body. Trace %s")
|
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
|
// ReadForm binds the formObject with the form data
|
||||||
// it supports any kind of struct.
|
// it supports any kind of struct.
|
||||||
//
|
//
|
||||||
|
@ -2421,7 +2424,7 @@ var (
|
||||||
func (ctx *context) ReadForm(formObject interface{}) error {
|
func (ctx *context) ReadForm(formObject interface{}) error {
|
||||||
values := ctx.FormValues()
|
values := ctx.FormValues()
|
||||||
if values == nil {
|
if values == nil {
|
||||||
return errors.New("An empty form passed on ReadForm")
|
return ErrEmptyForm
|
||||||
}
|
}
|
||||||
|
|
||||||
// or dec := formbinder.NewDecoder(&formbinder.DecoderOptions{TagName: "form"})
|
// or dec := formbinder.NewDecoder(&formbinder.DecoderOptions{TagName: "form"})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user