mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
12 lines
337 B
TypeScript
12 lines
337 B
TypeScript
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);
|
|
};
|