Skip to content

Commit

Permalink
prevent from returning 500
Browse files Browse the repository at this point in the history
  • Loading branch information
refs committed Jul 15, 2021
1 parent e565c04 commit 905fa4c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions internal/http/services/owncloud/ocdav/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,13 @@ func (s *svc) deleteReceivedShare(ctx context.Context, p string, client gatewayv
})
if err != nil {
sublog.Error().Err(err).Str("path", p).Msg("stat resource")
w.WriteHeader(http.StatusInternalServerError)
return err
}

// if the deleted item matches a shared resource delete it from the trash
sRes, err := client.ListReceivedShares(ctx, &sharing.ListReceivedSharesRequest{})
if err != nil {
sublog.Error().Err(err).Str("path", p).Msg("listing received shares")
w.WriteHeader(http.StatusInternalServerError)
return err
}

Expand Down Expand Up @@ -160,7 +158,6 @@ func (s *svc) deleteReceivedShare(ctx context.Context, p string, client gatewayv
_, err := client.UpdateReceivedShare(ctx, r)
if err != nil {
sublog.Error().Err(err).Msg("updating share status")
w.WriteHeader(http.StatusInternalServerError)
return err
}
}
Expand Down

0 comments on commit 905fa4c

Please sign in to comment.