Supabase error standardization (#12879)

Signed-off-by: thesynthax <kushagra1403@gmail.com>
This commit is contained in:
Kushagra Srivastava 2025-05-23 20:32:56 +05:30 committed by GitHub
parent 64c8e8af9c
commit f28dc8b1f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,7 +69,16 @@ export default class Supabase implements QueryService {
}
if (error) {
throw new QueryError('Query could not be completed', error, {});
const errorMessage = error?.message || "An unknown error occurred.";
let errorDetails: any = {};
const supabaseError = error as any;
const { code, hint } = supabaseError;
errorDetails.code = code;
errorDetails.hint = hint;
throw new QueryError('Query could not be completed', errorMessage, errorDetails);
}
return {