storj / team-metainfo

GNU Affero General Public License v3.0
0 stars 0 forks source link

Fix error message for "object already exists" for move operation #76

Closed mniewrzal closed 2 years ago

mniewrzal commented 2 years ago

Currently when user will try to move an object to a location where a different object already exists is very unfriendly

uplink mv sj://cakes/New-York/cheesecake.jpg sj://new-recipes/cakes/cheesecake.jpg

Error: uplink: metaclient: metabase: unable to update object: ERROR: duplicate key value violates unique constraint "primary" (SQLSTATE 23505)

We should return "object already exists" error message + we need to return correct DRPC status code AlreadyExists.

https://docs.storj.io/dcs/api-reference/uplink-cli/mv#troubleshooting-move-errors

storjBuildBot commented 2 years ago

Change https://review.dev.storj.io/c/storj/storj/+/6739 mentions this issue.