mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Supabase error standardization (#12879)
Signed-off-by: thesynthax <kushagra1403@gmail.com>
This commit is contained in:
parent
64c8e8af9c
commit
f28dc8b1f2
1 changed files with 10 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue