supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
656 stars 154 forks source link

Postgres function name should be given in postgrest error message when error occurs #900

Closed Jonny1987 closed 1 month ago

Jonny1987 commented 1 month ago

Describe the bug If I make a call to a postres function which contains an error from flutter using supabase, I get no information in the error about which postgres function was called. This issue combined with issue #899 makes these error very hard to debug.

eg:

PostgrestException(message: column "var.overall_rating" must appear in the GROUP BY clause or be used in an aggregate function, code: 42803, details: Bad Request, hint: null), #0      PostgrestBuilder._parseResponse (package:postgrest/src/postgrest_builder.dart:283:7)
 #1      PostgrestBuilder._execute (package:postgrest/src/postgrest_builder.dart:164:14)
<asynchronous suspension>
 #2      PostgrestBuilder.then (package:postgrest/src/postgrest_builder.dart:372:24)
<asynchronous suspension>

To Reproduce Call an existing postges function which contains an error using supabase.rpc('myfunction')

Expected behavior The name of the postgres function should be given in the error message

dshukertjr commented 1 month ago

If you call a Postgres function and it throws an exception, it's obvious which function threw the error, the one that you just called.