This commit is contained in:
Mateusz Gruszczyński committed 2026-10-14 14:55:04 +02:00
1 parent 9e133628e5
commit 0abc8e871d
6 files changed
+47 -7

No files matched your search

+3 -1
View File
@@ -164,7 +164,9 @@ export async function api(path, options = {}) {
logWarn("api.timeout", { method: options.method || "GET", path });
throw new Error(translateApiMessage("Timed out"));
}
logError("api.network_error", error, { method: options.method || "GET", path });
// HTTP failures have already been logged as api.failed above.
// Only transport failures should be reported as network errors.
if (!error?.status) logError("api.network_error", error, { method: options.method || "GET", path });
if (options.body instanceof FormData && error instanceof TypeError) {
throw new Error(translateApiMessage("Upload failed before the server returned a response. The file may exceed the server or proxy upload limit."));
}