🐛 (fix) handle the fetch error

This commit is contained in:
2025-09-08 22:58:05 +07:00
parent 5ead7c7197
commit 1899050ceb

View File

@ -2,8 +2,12 @@
import { api } from "@/shared/api/connector";
const getOauthProviderList = async () => {
const res = await api.get(`auth/providers`);
return res.json();
try {
const res = await api.get(`auth/providers`);
return res.json();
} catch (error) {
throw new Error("Failed to fetch OAuth providers", { cause: error });
}
};
export default getOauthProviderList;