diff options
| author | Adam <[email protected]> | 2026-02-27 09:45:00 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-27 09:45:00 -0600 |
| commit | 6ef3af73dfa1c72bb2001c86d898f2edf8ea4b10 (patch) | |
| tree | 845adb9ccc47884a0f102a59cb887bd17a51a75c /packages/app/src/context/global-sync | |
| parent | e5ae6c51b0d2f5dececd16970250aa2ab6c71a2f (diff) | |
| download | opencode-6ef3af73dfa1c72bb2001c86d898f2edf8ea4b10.tar.gz opencode-6ef3af73dfa1c72bb2001c86d898f2edf8ea4b10.zip | |
chore(app): i18n sync (#15362)
Diffstat (limited to 'packages/app/src/context/global-sync')
| -rw-r--r-- | packages/app/src/context/global-sync/bootstrap.ts | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/packages/app/src/context/global-sync/bootstrap.ts b/packages/app/src/context/global-sync/bootstrap.ts index b26106561..bc84eb169 100644 --- a/packages/app/src/context/global-sync/bootstrap.ts +++ b/packages/app/src/context/global-sync/bootstrap.ts @@ -36,6 +36,9 @@ export async function bootstrapGlobal(input: { connectErrorTitle: string connectErrorDescription: string requestFailedTitle: string + unknownError: string + invalidConfigurationError: string + formatMoreCount: (count: number) => string setGlobalStore: SetStoreFunction<GlobalStore> }) { const health = await input.globalSDK.global @@ -88,8 +91,11 @@ export async function bootstrapGlobal(input: { const results = await Promise.allSettled(tasks) const errors = results.filter((r): r is PromiseRejectedResult => r.status === "rejected").map((r) => r.reason) if (errors.length) { - const message = errors[0] instanceof Error ? errors[0].message : String(errors[0]) - const more = errors.length > 1 ? ` (+${errors.length - 1} more)` : "" + const message = formatServerError(errors[0], { + unknown: input.unknownError, + invalidConfiguration: input.invalidConfigurationError, + }) + const more = errors.length > 1 ? input.formatMoreCount(errors.length - 1) : "" showToast({ variant: "error", title: input.requestFailedTitle, @@ -116,6 +122,8 @@ export async function bootstrapDirectory(input: { setStore: SetStoreFunction<State> vcsCache: VcsCache loadSessions: (directory: string) => Promise<void> | void + unknownError: string + invalidConfigurationError: string }) { if (input.store.status !== "complete") input.setStore("status", "loading") @@ -137,7 +145,10 @@ export async function bootstrapDirectory(input: { showToast({ variant: "error", title: `Failed to reload ${project}`, - description: formatServerError(err), + description: formatServerError(err, { + unknown: input.unknownError, + invalidConfiguration: input.invalidConfigurationError, + }), }) input.setStore("status", "partial") return |
