From 2fa0cc798da75e344121b970aa8709eebafcb89c Mon Sep 17 00:00:00 2001 From: Tyler <18113850+dshukertjr@users.noreply.github.com> Date: Tue, 2 Aug 2022 16:25:23 +0900 Subject: [PATCH] fix: improvement on description of the throwing vs returning errors Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com> --- ...-with-you-the-supabase-flutter-sdk-1-developer-preview.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/www/_blog/2022-08-01-sharing-with-you-the-supabase-flutter-sdk-1-developer-preview.mdx b/apps/www/_blog/2022-08-01-sharing-with-you-the-supabase-flutter-sdk-1-developer-preview.mdx index 13c9623bb28..7c5b34c08a9 100644 --- a/apps/www/_blog/2022-08-01-sharing-with-you-the-supabase-flutter-sdk-1-developer-preview.mdx +++ b/apps/www/_blog/2022-08-01-sharing-with-you-the-supabase-flutter-sdk-1-developer-preview.mdx @@ -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