AIX: client error: describe Failed to fetch

This happens when for instance Chrome queues up a connection, and while still queued
the WiFi goes off.
This commit is contained in:
Enrico Ros
2026-03-27 04:20:59 -07:00
parent 5d5bc403c4
commit 0338b3d2e9
@@ -50,6 +50,13 @@ export function aixClassifyStreamingError(error: any, isUserAbort: boolean, hasF
// Initial connection failures, HTTP errors, or text responses that blow up tRPC's JSON parser
if (error instanceof TRPCClientError) {
switch (error.cause?.message) {
/**
* When network is disconnected while a request hasn't started (is queued by the browser).
* - repro: queue up > 6 connections, then turn WiFi off (no CSF).
*/
case 'Failed to Fetch':
return { errorType: 'net-disconnected', errorMessage: 'An issue occurred: **network error**' };
/**
* The body of the response was "Request Entity Too Large".
* - this caused trpc, in ...stream/jsonl.ts, function createConsumerStream, to throw an error due to parsing the line as JSON