FeatureFuel
8

Option to have supabase client throw error instead of returning it

Source: supabase/supabase#604 · opened by @mstade
Hey!

So when we make a query with the supabase client, it might look something like:



Any potential error (such as no rows returned, making .single() unhappy) would then show up as the error key in the results object. So you might end up with patterns like so:



Would it perhaps be possible to give the client an option, perhaps as part of initialization, so that it would throw these errors instead of just returning them as part of the result? You'd still have to catch the errors somewhere of course. There's nothing necessarily wrong with the current interface, it's just that it tends to get noisy I find. Especially when you do multiple queries where the subsequent ones depend on the previous. A transaction interface (see #526) would probably go a long way in alleviating this (while being *better* as well) but even so I think having the option would give us exception using plebs a nice option for control flow. :o)

What'ya reckon?

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests