Replace DAVError with HTTPError + Error
That way we can avoid having different ways of representing the same error value.
This commit is contained in:
@@ -327,14 +327,10 @@ const (
|
||||
func NewPreconditionError(err PreconditionType) error {
|
||||
name := xml.Name{"urn:ietf:params:xml:ns:caldav", string(err)}
|
||||
elem := internal.NewRawXMLElement(name, nil, nil)
|
||||
e := internal.Error{
|
||||
Raw: []internal.RawXMLValue{
|
||||
*elem,
|
||||
return &internal.HTTPError{
|
||||
Code: 409,
|
||||
Err: &internal.Error{
|
||||
Raw: []internal.RawXMLValue{*elem},
|
||||
},
|
||||
}
|
||||
return &internal.DAVError{
|
||||
Code: 409,
|
||||
Msg: fmt.Sprintf("precondition not met: %s", string(err)),
|
||||
Err: e,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user