diff --git a/src/utils/fetch.ts b/src/utils/fetch.ts index 2994f7c..14673e2 100644 --- a/src/utils/fetch.ts +++ b/src/utils/fetch.ts @@ -40,7 +40,7 @@ export async function fetchApi(route: string, config?: NextFet return fetch(`${process.env.NEXT_PUBLIC_API_URL}/api${route}`, { ...config, headers }) .then(async (resp) => { if (!resp.ok) { - return Promise.reject(resp); + return Promise.reject(new Error(`${resp.url}: ${resp.status} ${resp.statusText}`)); } if (resp.headers.get('Content-Type') === 'application/json') {