Localize provider errors
This commit is contained in:
1 parent
abaf845e94
commit
958cc68cba
3 files changed
+9
-6
No files matched your search
@@ -126,6 +126,7 @@ const createAssistantAttachmentAdapter = (allowImages: boolean): AttachmentAdapt
|
||||
};
|
||||
|
||||
const AssistantPreferencesProvider = ({ children }: PropsWithChildren) => {
|
||||
const t = useScopedI18n("common.assistant");
|
||||
const { data, isLoading } = clientApi.assistant.getRuntimeOptions.useQuery(undefined, {
|
||||
staleTime: 10 * 60_000,
|
||||
});
|
||||
@@ -192,9 +193,9 @@ const AssistantPreferencesProvider = ({ children }: PropsWithChildren) => {
|
||||
try {
|
||||
const nextQuota = await workshopClient.getAssistantUsage(controller.signal);
|
||||
if (quotaRequestRef.current === controller && !controller.signal.aborted) setQuota(nextQuota);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
if (quotaRequestRef.current === controller && !controller.signal.aborted) {
|
||||
setQuotaError(error instanceof Error ? error.message : "The Homarr provider allowance could not be loaded.");
|
||||
setQuotaError(t("providerQuota.loadError"));
|
||||
}
|
||||
} finally {
|
||||
if (quotaRequestRef.current === controller) {
|
||||
@@ -202,7 +203,7 @@ const AssistantPreferencesProvider = ({ children }: PropsWithChildren) => {
|
||||
setQuotaLoading(false);
|
||||
}
|
||||
}
|
||||
}, [data?.provider, workshopClient]);
|
||||
}, [data?.provider, t, workshopClient]);
|
||||
const signInToProvider = useCallback(async () => {
|
||||
setQuotaLoading(true);
|
||||
setQuotaError(null);
|
||||
@@ -211,12 +212,12 @@ const AssistantPreferencesProvider = ({ children }: PropsWithChildren) => {
|
||||
setProviderUser(user);
|
||||
await refreshQuota();
|
||||
} catch (error) {
|
||||
setQuotaError(error instanceof Error ? error.message : "GitHub sign-in failed.");
|
||||
setQuotaError(t("providerQuota.signInError"));
|
||||
throw error;
|
||||
} finally {
|
||||
setQuotaLoading(false);
|
||||
}
|
||||
}, [refreshQuota, workshopClient]);
|
||||
}, [refreshQuota, t, workshopClient]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!data) return;
|
||||
|
||||
@@ -62,7 +62,7 @@ for client_id in workshop-test-client workshop-rotated-client; do
|
||||
node apps/workshop/tests/oauth-sync.integration.mjs
|
||||
done
|
||||
|
||||
OPENROUTER_API_KEY= PB_EXPOSE_PORT="$WORKSHOP_TEST_PORT" docker compose -p "$WORKSHOP_TEST_PROJECT" \
|
||||
OPENROUTER_API_KEY="" PB_EXPOSE_PORT="$WORKSHOP_TEST_PORT" docker compose -p "$WORKSHOP_TEST_PROJECT" \
|
||||
-f apps/workshop/docker-compose.yml up -d --force-recreate workshop
|
||||
for attempt in $(seq 1 60); do
|
||||
if curl --fail --silent "http://127.0.0.1:$WORKSHOP_TEST_PORT/api/health" >/dev/null; then
|
||||
|
||||
@@ -2094,6 +2094,8 @@
|
||||
"exhaustedDescription": "Your Homarr provider allowance is used for today. It resets at midnight UTC.",
|
||||
"unavailableDescription": "Sign in to the Workshop or wait for your Homarr provider allowance to reset.",
|
||||
"signIn": "Sign in with GitHub",
|
||||
"signInError": "GitHub sign-in failed. Try again in a moment.",
|
||||
"loadError": "The Homarr provider allowance could not be loaded.",
|
||||
"reset": "Resets {relative} at <time></time>",
|
||||
"toolCalls": "Each model request and completed tool call uses one request.",
|
||||
"retry": "Reload allowance",
|
||||
|
||||
Reference in new issue
Block a user