It would seem like raising exceptions don't get pa...
# sql
s
It would seem like raising exceptions don't get passed back down through the Supabase library, I'm trying to raise an exception on a trigger function on the
auth.users
table and the only error I'm getting is "Database error saving new user" while I was expecting the message from the exception to show instead.
To be more clear, raising an exception works when using a
.rpc
but not when using a trigger function as part of the signUp or signIn process
c
Does your trigger run before or after the insert/update? I would assume that if it is after, you will NOT know about it but it will be strange if it is BEFORE the insert/update and you still get 200 on the REST call
s
It's before, this definitely has to do with how the API endpoint for signUp/signIn handles exceptions
I also noticed that emails get sent even if the db transaction was aborted
Raising an exception would abort all further db transactions, but an email is sent before the db transaction even takes place
c
I see - this doesn't make sense to me. Have you opened an Issue on GitHub?
s
c
Btw - what happens if the user clicks on the link that was still sent - I hope nothing (i.e. they are not confirmed since no record actually exists in the DB), right?
s
Yes correct, it will return a fragment in the url with error_code 404 and error_description "Confirmation Token not found"