From 367afab430c12bea4ca0e3dbbc1430ea5a1b870d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Sat, 31 Jan 2026 23:17:48 +0100 Subject: [PATCH] Add diagnostics for MKCOL failures in ensureParent method --- go_cloud/internal/storage/webdav.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go_cloud/internal/storage/webdav.go b/go_cloud/internal/storage/webdav.go index 490f98e..4d53853 100644 --- a/go_cloud/internal/storage/webdav.go +++ b/go_cloud/internal/storage/webdav.go @@ -77,11 +77,15 @@ func (c *WebDAVClient) ensureParent(ctx context.Context, remotePath string) erro if err != nil { return err } + // Read body for diagnostics + b, _ := io.ReadAll(resp.Body) resp.Body.Close() // 201 created, 405 exists — ignore if resp.StatusCode == 201 || resp.StatusCode == 405 { continue } + // Any other status is an error: return with diagnostics so caller can log and act on it + return fmt.Errorf("MKCOL failed for %s: status=%d body=%s", mkurl, resp.StatusCode, string(b)) } return nil }