@@ -13,6 +13,7 @@ import (
13
13
"github.com/gogf/gf/encoding/gjson"
14
14
"github.com/gogf/gf/encoding/gurl"
15
15
"github.com/gogf/gf/encoding/gxml"
16
+ "github.com/gogf/gf/errors/gerror"
16
17
"github.com/gogf/gf/internal/json"
17
18
"github.com/gogf/gf/internal/utils"
18
19
"github.com/gogf/gf/text/gregex"
@@ -299,7 +300,7 @@ func (r *Request) parseQuery() {
299
300
var err error
300
301
r .queryMap , err = gstr .Parse (r .URL .RawQuery )
301
302
if err != nil {
302
- panic (err )
303
+ panic (gerror . WrapCode ( gerror . CodeInvalidParameter , err , "" ) )
303
304
}
304
305
}
305
306
}
@@ -354,12 +355,12 @@ func (r *Request) parseForm() {
354
355
if gstr .Contains (contentType , "multipart/" ) {
355
356
// multipart/form-data, multipart/mixed
356
357
if err = r .ParseMultipartForm (r .Server .config .FormParsingMemory ); err != nil {
357
- panic (err )
358
+ panic (gerror . WrapCode ( gerror . CodeInvalidRequest , err , "" ) )
358
359
}
359
360
} else if gstr .Contains (contentType , "form" ) {
360
361
// application/x-www-form-urlencoded
361
362
if err = r .Request .ParseForm (); err != nil {
362
- panic (err )
363
+ panic (gerror . WrapCode ( gerror . CodeInvalidRequest , err , "" ) )
363
364
}
364
365
}
365
366
if len (r .PostForm ) > 0 {
@@ -402,7 +403,7 @@ func (r *Request) parseForm() {
402
403
}
403
404
if params != "" {
404
405
if r .formMap , err = gstr .Parse (params ); err != nil {
405
- panic (err )
406
+ panic (gerror . WrapCode ( gerror . CodeInvalidParameter , err , "" ) )
406
407
}
407
408
}
408
409
}
0 commit comments