carddav: use partial error response on multiget failure

Instead of making the whole HTTP request fail when a single address
object cannot be fetched, return a partial error response.
This commit is contained in:
Simon Ser 2022-04-29 15:24:24 +02:00
parent 46ebe58ac2
commit 8cc6542f1c

View File

@ -205,7 +205,9 @@ func (h *Handler) handleMultiget(ctx context.Context, w http.ResponseWriter, mul
for _, href := range multiget.Hrefs {
ao, err := h.Backend.GetAddressObject(ctx, href.Path, &dataReq)
if err != nil {
return err // TODO: create internal.Response with error
resp := internal.NewErrorResponse(href.Path, err)
resps = append(resps, *resp)
continue
}
b := backend{h.Backend}