mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
minor improvement
This commit is contained in:
parent
5f749453c7
commit
b1f2c24b64
|
@ -2842,8 +2842,8 @@ func (ctx *Context) ReadYAML(outPtr interface{}) error {
|
|||
|
||||
var (
|
||||
// IsErrEmptyJSON reports whether the given "err" is caused by a
|
||||
// Context.ReadJSON call when the request body
|
||||
// didn't start with { or it was totally empty.
|
||||
// Client.ReadJSON call when the request body was empty or
|
||||
// didn't start with { or [.
|
||||
IsErrEmptyJSON = func(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
|
@ -2858,8 +2858,9 @@ var (
|
|||
return v.Offset == 0 && v.Error() == "unexpected end of JSON input"
|
||||
}
|
||||
|
||||
// when optimization is enabled, the jsoniter will report the following error:
|
||||
return strings.Contains(err.Error(), "readObjectStart: expect {")
|
||||
errMsg := err.Error()
|
||||
// 3rd party pacakges:
|
||||
return strings.Contains(errMsg, "readObjectStart: expect {") || strings.Contains(errMsg, "readArrayStart: expect [")
|
||||
}
|
||||
|
||||
// IsErrPath can be used at `context#ReadForm` and `context#ReadQuery`.
|
||||
|
|
|
@ -557,6 +557,9 @@ func (s *step7) Run(runner Runner, configurators ...Configurator) error {
|
|||
// they will be called on interrupt signals too,
|
||||
// because Iris has a builtin mechanism to call server's shutdown on interrupt.
|
||||
for _, cb := range s.step6.closers {
|
||||
if cb == nil {
|
||||
continue
|
||||
}
|
||||
cb()
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue
Block a user