narrow abort pattern and harden isNetworkError

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-09-02 18:19:16 +03:00
parent 1d136b07ed
commit 2e652ba619
3 changed files with 127 additions and 8 deletions
+6 -1
View File
@@ -39,7 +39,12 @@ export function cleanError(e: unknown): string {
*/
// oxlint-disable-next-line typescript/no-base-to-string
const str = typeof e === 'string' ? e : e.toString()
if (isNetworkError(str)) {
/*
* Passed the original value, not `str`, so the wrapped-cause walk is
* reachable: the XRPC clients report the platform fetch failure as the
* `cause` of a generic message.
*/
if (isNetworkError(e)) {
return t`Unable to connect. Please check your internet connection and try again.`
}
/*