@@ -99,7 +99,7 @@ async def sign_in(self, email: str, password: str) -> None:
99
99
if "email" in str (err ).lower ():
100
100
# AuthApiError('Email not confirmed')
101
101
raise errors .EmailValidationRequiredError (err ) from err
102
- raise authentication .FailedAuthentication (err ) from err
102
+ raise authentication .FailedAuthentication (f"Community auth error: { err } " ) from err
103
103
104
104
async def sign_up (self , email : str , password : str ) -> None :
105
105
try :
@@ -117,7 +117,7 @@ async def sign_up(self, email: str, password: str) -> None:
117
117
if self ._requires_email_validation (resp .user ):
118
118
raise errors .EmailValidationRequiredError ()
119
119
except gotrue .errors .AuthError as err :
120
- raise authentication .AuthenticationError (err ) from err
120
+ raise authentication .AuthenticationError (f"Community auth error: { err } " ) from err
121
121
122
122
async def sign_out (self , options : gotrue .types .SignOutOptions ) -> None :
123
123
try :
@@ -132,13 +132,13 @@ async def restore_session(self):
132
132
self .event_loop = asyncio .get_event_loop ()
133
133
await self .auth .initialize_from_storage ()
134
134
if not self .is_signed_in ():
135
- raise authentication .FailedAuthentication ()
135
+ raise authentication .FailedAuthentication (f"Community auth error: restoring session failed" )
136
136
137
137
async def refresh_session (self , refresh_token : typing .Union [str , None ] = None ):
138
138
try :
139
139
await self .auth .refresh_session (refresh_token = refresh_token )
140
140
except gotrue .errors .AuthError as err :
141
- raise authentication .AuthenticationError (err ) from err
141
+ raise authentication .AuthenticationError (f"Community auth error: { err } " ) from err
142
142
143
143
async def sign_in_with_otp_token (self , token ):
144
144
self .event_loop = asyncio .get_event_loop ()
@@ -156,7 +156,7 @@ async def sign_in_with_otp_token(self, token):
156
156
except gotrue .errors .AuthImplicitGrantRedirectError as err :
157
157
if saved_session :
158
158
await self .auth ._storage .set_item (self .auth ._storage_key , saved_session )
159
- raise authentication .AuthenticationError (err ) from err
159
+ raise authentication .AuthenticationError (f"Community auth error: { err } " ) from err
160
160
161
161
def is_signed_in (self ) -> bool :
162
162
# is signed in when a user auth key is set
@@ -201,7 +201,7 @@ async def get_otp_with_auth_key(self, user_email: str, auth_key: str) -> str:
201
201
)
202
202
return json .loads (resp )["token" ]
203
203
except Exception :
204
- raise authentication .AuthenticationError (f"Invalid auth key authentication details" )
204
+ raise authentication .AuthenticationError (f"Community auth error: invalid auth key authentication details" )
205
205
206
206
async def fetch_extensions (self , mqtt_uuid : typing .Optional [str ]) -> dict :
207
207
resp = await self .functions .invoke (
0 commit comments