-
Notifications
You must be signed in to change notification settings - Fork 21
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
Exceptions are a serious problem. #41
Comments
Totally agree. Exceptions thrown by Realtime is not catchable as well with try-catch. It crashes the app straightaway. Realtime should use a callback for errors instead of throwing exceptions. |
The Android client is an important user group of the BAAS platform architecture. It is really confusing to use such a large number of exception handling methods. |
Hi @muratdoglu, we are always open to improvements, in what way would you prefer to handle errors? Maybe methods that return an error object or similar instead of throwing, or did you have something else in mind? |
@abnegate I think, It's a good sample;
|
@muratdoglu While that kind of pattern is common for callback based asynchronous code, when using structured concurrency like Kotlin coroutines, it is common to use exceptions. Doing so leads to allowing cleaner and more straight forward code when compared to callbacks. There are another couple of options, but neither quite provide the same flexibility while sticking to language idioms:
For these reasons, we'll stick with exceptions for now |
👟 Reproduction steps
Sending exceptions in every negative case of the application leads to serious issues. Is it correct to use try-catch everywhere.
Even though I don't use try-catch, some exceptions still cause the application to crash. Firebase Crashlytics is full of crashes. We need to urgently move away from this try-catch approach. If necessary, it should be handled within the SDK. We shouldn't force the person using the SDK to put try-catch everywhere; it's not clean code at all.
👍 Expected behavior
lol
👎 Actual Behavior
lol
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Linux
🧱 Your Environment
lol
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: