appwrite icon indicating copy to clipboard operation
appwrite copied to clipboard

🚀 Feature: Database - Return attribute or index name on 409 error (document_already_exists)

Open pilcrowonpaper opened this issue 3 years ago • 1 comments

🔖 Feature description

When a user tries to create a document that violates a unique type index, return the name of the index or attribute that it violates.

Current:

{
   "code": "document_already_exists",
   "message": "Document already exists"
}

New:

{
   "code": "document_already_exists",
   "message": "Document already exists: document violates type unique for index 'index_name'"
}

🎤 Pitch

If you have a website where users can store items with multiple unique attributes, it would be nice to tell the user which input should be fixed.

👀 Have you spent some time to check if this issue has been raised before?

  • [x] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

pilcrowonpaper avatar Jul 31 '22 03:07 pilcrowonpaper

Thank you for raising this issue! 🙏 I'll be sure to pass this feedback to the team!

stnguyen90 avatar Aug 01 '22 17:08 stnguyen90