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: A Way to Check if the Error is Appwrite Exception #6324

Open
2 tasks done
thevinitgupta opened this issue Sep 25, 2023 · 5 comments
Open
2 tasks done
Assignees

Comments

@thevinitgupta
Copy link

馃敄 Feature description

Just like Firebase provides the functionality to check if the error comes from Firebase side, Appwrite should have a method or function to check if the error in the catch block is an AppwriteException.

馃帳 Pitch

A response from Appwrite has a name property that specifies : AppwriteException but a direct checker would be nice to have. It would enhance the Developer Experience

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

@Megamannen
Copy link

Use the built in javascript function err instanceof AppwriteException

@ItzNotABug
Copy link
Contributor

Can't we manually do that?

try {
    // appwrite operation
} catch (exception: AppwriteException) {
    // appwrite exception, do what you want here 
} catch (exception: Exception) {
    // other generic exceptions
}

@thevinitgupta
Copy link
Author

Since this exception is occuring on the Appwrite cloud, there is no way to know if the exception is an Appwrite exception since we only receive a JSON object with the error and status codes.

@stnguyen90
Copy link
Contributor

@thevinitgupta, thanks for raising this issue! 馃檹馃徏 Would you please provide more detail about what kind of exception you're trying to capture?

@iamabhiCH
Copy link

Hello, @thevinitgupta I want to check this issue and fix this issue. Please assign this task to me.

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

No branches or pull requests

5 participants