mirror of
https://github.com/1f349/go-webdav.git
synced 2025-04-01 17:55:05 +01:00
Add error returning for missing error output paths.
This commit is contained in:
parent
9094f8327e
commit
2281ef31f1
@ -187,9 +187,8 @@ func NewPropFindResponse(path string, propfind *PropFind, props map[xml.Name]Pro
|
||||
|
||||
code := http.StatusOK
|
||||
if err != nil {
|
||||
// TODO: don't throw away error message here
|
||||
code = HTTPErrorFromError(err).Code
|
||||
val = emptyVal
|
||||
val = NewRawXMLElement(xmlName, []xml.Attr{{Name: xml.Name{Space: "ERR", Local: "Error"}, Value: err.Error()}}, nil)
|
||||
}
|
||||
|
||||
if err := resp.EncodeProp(code, val); err != nil {
|
||||
@ -210,8 +209,8 @@ func NewPropFindResponse(path string, propfind *PropFind, props map[xml.Name]Pro
|
||||
f, ok := props[xmlName]
|
||||
if ok {
|
||||
if v, err := f(&raw); err != nil {
|
||||
// TODO: don't throw away error message here
|
||||
code = HTTPErrorFromError(err).Code
|
||||
val = NewRawXMLElement(xmlName, []xml.Attr{{Name: xml.Name{Space: "ERR", Local: "Error"}, Value: err.Error()}}, nil)
|
||||
} else {
|
||||
code = http.StatusOK
|
||||
val = v
|
||||
|
Loading…
x
Reference in New Issue
Block a user