Skip to content

🚀 Feature: Constants for error Types #149

Open

Description

@santigarcor

🔖 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?

Activity

  1. joeyouss commented on May 29, 2023

    @joeyouss

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

  2. self-assigned this
    on May 29, 2023
  3. added
    enhancement
    on May 29, 2023
  4. eldadfux commented on May 29, 2023

    @eldadfux
    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!

  5. santigarcor commented on May 29, 2023

    @santigarcor
    Author

    Is there anything I can do to help?

  6. eldadfux commented on May 29, 2023

    @eldadfux
    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

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions