0.2.89
This commit is contained in:
1 parent
9e133628e5
commit
0abc8e871d
6 files changed
+47
-7
No files matched your search
+3
-1
@@ -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."));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user