Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Improve Database Exception Handling #7731

Open
2 tasks done
EVDOG4LIFE opened this issue Mar 5, 2024 · 1 comment
Open
2 tasks done

🚀 Feature: Improve Database Exception Handling #7731

EVDOG4LIFE opened this issue Mar 5, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database.

Comments

@EVDOG4LIFE
Copy link
Member

🔖 Feature description

When attempting to create a document that contains a non unique attribute on a collection that has a Unique index, you are given a misleading and generic error such as:

Failed to insert document: Document with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.

The enhancement here, will be to call out which attribute is causing the exception.

🎤 Pitch

When returning exceptions, we need to be verbose and provide which attribute is causing the conflict.

For example, I have a Unique index on a column named email. [email protected] is already taken, but when trying to create a new document with the same value, it should not return Failed to insert document: Document with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID., but instead return something like Failed to insert document: Duplicate key {$id} violates unique constraint on {$key}. Try again with a different ID or use ID.unique() to generate a unique ID.

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

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@EVDOG4LIFE EVDOG4LIFE added enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database. feature labels Mar 5, 2024
@7777chaitanya
Copy link

@EVDOG4LIFE , I am willing to take up this issue. Could you assign this to me, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

3 participants