mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 02:45:07 +03:00
fix: improvement on description of the throwing vs returning errors
Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>
This commit is contained in:
1 parent
e7e99f015a
commit
2fa0cc798d
1 file changed
+3
-1
+3
-1
@@ -67,7 +67,9 @@ await Supabase.instance.initialize(
|
||||
|
||||
### Throwing errors instead of returning them
|
||||
|
||||
When supabase-dart and supabase-flutter were created, we wanted to mirror the Javascript library as much as possible, but we soon realized that some syntax does not fit well when they are written in Dart. Throwing vs returning error is a good example of that. Since Dart does not have object destruction, the code becomes a bit tedious when errors are returned. That is why with supabase-flutter 1.0, we are going to throw errors instead of returning it. This is consistent across all features from auth, postgrest and storage.
|
||||
When `supabase-dart` and `supabase-flutter` were created, we wanted to mirror the JavaScript library as much as possible. We soon realized that some syntax does not fit well when written in Dart. Throwing vs returning error is a good example of that. Since Dart does not have object destruction, the code becomes a bit tedious when errors are returned.
|
||||
|
||||
With `supabase-flutter` 1.0, we are throwing errors instead of returning them. This is consistent across all features from `auth`, `postgrest`, and `storage`.
|
||||
|
||||
```dart
|
||||
// Before
|
||||
|
||||
Reference in new issue
Block a user