mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-23 00:34:23 +00:00
internal: check for response error in Multistatus.Get
This commit is contained in:
parent
6e0ea58de1
commit
d8ce7d353d
@ -71,7 +71,7 @@ func (ms *Multistatus) Get(href string) (*Response, error) {
|
|||||||
resp := &ms.Responses[i]
|
resp := &ms.Responses[i]
|
||||||
for _, h := range resp.Hrefs {
|
for _, h := range resp.Hrefs {
|
||||||
if h == href {
|
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 {
|
func (resp *Response) DecodeProp(v interface{}) error {
|
||||||
|
// TODO wrap errors with more context (XML name)
|
||||||
name, err := valueXMLName(v)
|
name, err := valueXMLName(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user