I'm trying to make sure my code handles exceptions properly. I saw that people kept getting the AppwriteException whenever something went wrong.
My question is if I can just catch AppwriteException for every function?
static Future<models.Account> createAccount(String email, String password) async {
try {
return await account.create(userId: ID.unique(), email: email, password: password);
} on AppwriteException catch (e) {
Get.snackbar('Error!', e.message.toString());
rethrow;
}
}
This is what I'm doing right now in Flutter. Would this work for any other function of the appwrite sdk?