fux
This commit is contained in:
@@ -21,6 +21,12 @@ export async function clientFetch<T = any>(url: string, options: RequestInit = {
|
||||
if (!res.ok) {
|
||||
const errorData = await res.json().catch(() => ({}));
|
||||
const errorMessage = errorData.message || errorData.error || `Request failed: ${res.status} ${res.statusText}`;
|
||||
console.error('API Error:', {
|
||||
status: res.status,
|
||||
url: fullUrl,
|
||||
response: errorData,
|
||||
method: options.method || 'GET'
|
||||
});
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user