@devries-cameron20 / t3code-1 / commits / eca102b633
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): browser load errors with digits keep their full name (#24244)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

MarcoDotIO committed Oct 30, 2026 at 17:04 UTC eca102b63300d8844f12db9a19e00e799314909c
2 files changed +16 -1
apps/server/src/preview/ServerBrowserPage.test.ts
+14
@@ -388,3 +388,17 @@ describe("server browser drag", () => {
388 }
389 });
390 });
391 +
392 +describe("server browser net errors", () => {
393 + it.each([
394 + ["net::ERR_CONNECTION_REFUSED", "ERR_CONNECTION_REFUSED", -102],
395 + [
396 + "page.goto: net::ERR_HTTP2_PROTOCOL_ERROR at https://localhost:5173/",
397 + "ERR_HTTP2_PROTOCOL_ERROR",
398 + -2,
399 + ],
400 + ["net::ERR_TLS13_DOWNGRADE_DETECTED", "ERR_TLS13_DOWNGRADE_DETECTED", -2],
401 + ])("reads the whole error name from %j", (errorText, description, code) => {
402 + expect(ServerBrowserPage.parseNetError(errorText)).toEqual({ description, code });
403 + });
404 +});
apps/server/src/preview/ServerBrowserPage.ts
+2 -1
@@ -894,7 +894,8 @@ const NET_ERROR_CODES: Readonly<Record<string, number>> = {
894 };
895
896 export const parseNetError = (errorText: string) => {
897 - const description = /ERR_[A-Z_]+/.exec(errorText)?.[0] ?? errorText;
897 + // Names can hold digits, as in ERR_HTTP2_PROTOCOL_ERROR.
898 + const description = /ERR_[A-Z\d_]+/.exec(errorText)?.[0] ?? errorText;
899 return { description, code: NET_ERROR_CODES[description] ?? -2 };
900 };
901