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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Constants for error Types #149

Open
2 tasks done
Tracked by #698
santigarcor opened this issue May 26, 2023 · 4 comments
Open
2 tasks done
Tracked by #698

馃殌 Feature: Constants for error Types #149

santigarcor opened this issue May 26, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@santigarcor
Copy link

馃敄 Feature description

For the error types exposed here we should have a class with constants or an enum so we don't have to manually put the string in the code.

馃帳 Pitch

Let say I want to display some error message specifically to the user depending on the type, so instead of doing this:

AppWriteException exception;
if (exception.type == 'user_already_exists') {
...
}

I could use the constant instead

AppWriteException exception;

if (exception.type == ErrorType.userAlreadyExists) {
...
}

馃憖 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?

@joeyouss
Copy link

Hi - thank you for opening this
This really does sound helpful, keeping it open for gathering feedback.

@joeyouss joeyouss self-assigned this May 29, 2023
@joeyouss joeyouss added the enhancement New feature or request label May 29, 2023
@eldadfux
Copy link
Member

This is a really good idea. We'll be working on implementing this across all of our SDKs. Thank you for the suggestion @santigarcor!

@santigarcor
Copy link
Author

Is there anything I can do to help?

@eldadfux
Copy link
Member

Not sure yet, but if there will be we'll keep updates in this issue 馃憤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants