mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
fork refine
This commit is contained in:
11
packages/supabase/src/utils/handleError.ts
Normal file
11
packages/supabase/src/utils/handleError.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { HttpError } from "@refinedev/core";
|
||||
import { PostgrestError } from "@supabase/supabase-js";
|
||||
|
||||
export const handleError = (error: PostgrestError) => {
|
||||
const customError: HttpError = {
|
||||
...error,
|
||||
message: error.message,
|
||||
statusCode: parseInt(error.code),
|
||||
};
|
||||
return Promise.reject(customError);
|
||||
};
|
||||
Reference in New Issue
Block a user