diff options
| author | Adam Soltys <[email protected]> | 2026-10-18 23:02:12 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-31 16:42:55 -0700 |
| commit | 5b34d1bacc4a9d9d30b26b5bf89845ceb51fc100 (patch) | |
| tree | aa758cff388acfd224ec47972231d4f55c592623 | |
| parent | 5fc1eaae521f4c34a8b10b7c983f86f0305b6c2b (diff) | |
| download | coinos-ui-5b34d1bacc4a9d9d30b26b5bf89845ceb51fc100.tar.gz coinos-ui-5b34d1bacc4a9d9d30b26b5bf89845ceb51fc100.zip | |
migrate: retry smaller on a shortfall in any language
The debit error is localized ("Unzureichende Mittel ⚡️20582 / 20600"),
so the English-only regex skipped the held-back retry for non-English
accounts. Also match the error's language-neutral ⚡️available / needed tail.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | src/routes/(app)/migrate/+page.server.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/routes/(app)/migrate/+page.server.ts b/src/routes/(app)/migrate/+page.server.ts index 48ae6a96..6559485f 100644 --- a/src/routes/(app)/migrate/+page.server.ts +++ b/src/routes/(app)/migrate/+page.server.ts @@ -81,8 +81,11 @@ export const actions = { } catch (e) { lastErr = e; const msg = String((e as any)?.message || e); - // only a shortfall is worth retrying smaller - if (!/insufficient|balance|not enough|fee/i.test(msg)) throw e; + // only a shortfall is worth retrying smaller. The server's debit + // error is in the user's language ("Unzureichende Mittel ⚡️20582 / + // 20600"), so match its numeric tail rather than just the words. + if (!/insufficient|balance|not enough|fee|⚡\uFE0F?\s*\d+\s*(\/|of)\s*⚡?\uFE0F?\s*\d+/i.test(msg)) + throw e; } } if (!sent) throw lastErr; |
