fix: show fallback message when import config error is empty#1725
Open
bluzername wants to merge 1 commit intofarion1231:mainfrom
Open
fix: show fallback message when import config error is empty#1725bluzername wants to merge 1 commit intofarion1231:mainfrom
bluzername wants to merge 1 commit intofarion1231:mainfrom
Conversation
farion1231
reviewed
Mar 28, 2026
Owner
farion1231
left a comment
There was a problem hiding this comment.
Thank you for your contribution! Could you please check whether it would be better to use the following approach?
ProviderList.tsx:243 — the project’s standard error extraction function should be used
- toast.error(error.message || t("provider.importCurrentFailed"));
- toast.error(extractErrorMessage(error) || t("provider.importCurrentFailed"));
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When clicking "Import Current Config" and the import fails (for example no model configuration available), the error notification popup shows with empty text. User sees the toast but has no idea what went wrong.
Screenshot from issue shows the empty error message clearly.
Root Cause
In
ProviderList.tsxline 243, theonErrorhandler doestoast.error(error.message). But sometimes the Tauri invoke returns an error whereerror.messageis empty string. The toast then renders with no visible text.Fix
Added fallback using
||operator:When
error.messageis empty, it shows the localized "Failed to import current configuration" text instead.Also added the
importCurrentFailedi18n key to all 3 locale files:Files changed
src/components/providers/ProviderList.tsx- added fallback in onError handlersrc/i18n/locales/en.json- added importCurrentFailed keysrc/i18n/locales/zh.json- added importCurrentFailed keysrc/i18n/locales/ja.json- added importCurrentFailed keyCloses #1715