internal: check for response error in Multistatus.Get

This commit is contained in:
Simon Ser 2020-01-19 15:41:08 +01:00
parent 6e0ea58de1
commit d8ce7d353d
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -71,7 +71,7 @@ func (ms *Multistatus) Get(href string) (*Response, error) {
resp := &ms.Responses[i]
for _, h := range resp.Hrefs {
if h == href {
return resp, nil
return resp, resp.Status.Err()
}
}
}
@ -121,6 +121,7 @@ func IsMissingProp(err error) bool {
}
func (resp *Response) DecodeProp(v interface{}) error {
// TODO wrap errors with more context (XML name)
name, err := valueXMLName(v)
if err != nil {
return err