Skip to content

Commit bf74d0e

Browse files
committed
Add tests to cover previously uncovered lines in bind.go
1 parent 1555007 commit bf74d0e

File tree

2 files changed

+583
-3
lines changed

2 files changed

+583
-3
lines changed

bind.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ func (b *DefaultBinder) BindBody(c Context, i interface{}) (err error) {
9595
}
9696
case MIMEApplicationXML, MIMETextXML:
9797
if err = xml.NewDecoder(req.Body).Decode(i); err != nil {
98-
if ute, ok := err.(*xml.UnsupportedTypeError); ok {
99-
return NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unsupported type error: type=%v, error=%v", ute.Type, ute.Error())).SetInternal(err)
100-
} else if se, ok := err.(*xml.SyntaxError); ok {
98+
if se, ok := err.(*xml.SyntaxError); ok {
10199
return NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Syntax error: line=%v, error=%v", se.Line, se.Error())).SetInternal(err)
102100
}
103101
return NewHTTPError(http.StatusBadRequest, err.Error()).SetInternal(err)

0 commit comments

Comments
 (0)