From 6ca20e2a70863d5a0724c8d92536e999b605129d Mon Sep 17 00:00:00 2001 From: vitalii Date: Wed, 20 Jun 2018 06:49:28 +0300 Subject: [PATCH] copyMove() function returns error in case of 409 status code --- requests.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requests.go b/requests.go index 5e047e8..58ba034 100644 --- a/requests.go +++ b/requests.go @@ -6,6 +6,7 @@ import ( "io" "net/http" "strings" + "errors" ) func (c *Client) req(method, path string, body io.Reader, intercept func(*http.Request)) (req *http.Response, err error) { @@ -121,7 +122,8 @@ func (c *Client) copymove(method string, oldpath string, newpath string, overwri log(fmt.Sprintf(" TODO handle %s - %s multistatus result %s", method, oldpath, String(data))) case 409: - // TODO create dst path + return errors.New("can not copy/move item [" + oldpath + "] to [" + + newpath + "]: destination path does not exist or wrong XML content of the request") } return newPathError(method, oldpath, s)