From 657e68efee2f8d1fd2bd36d15c4ab286d5f8ad31 Mon Sep 17 00:00:00 2001 From: flemming-it Date: Mon, 22 Jun 2026 00:50:21 +0200 Subject: [PATCH] fix(studio): show real download error, not 'hub not reachable' friendlyError now pattern-matches module-download failures ('download failed: ...') and renders a clear, copyable headline + the URL/status detail, instead of letting the gRPC-Unavailable default show the generic 'hub not reachable' banner. EN+DE l10n. Signed-off-by: flemming-it --- lib/data/friendly_error.dart | 13 +++++++++++++ lib/l10n/app_de.arb | 2 ++ lib/l10n/app_en.arb | 2 ++ lib/l10n/app_localizations.dart | 12 ++++++++++++ lib/l10n/app_localizations_de.dart | 7 +++++++ lib/l10n/app_localizations_en.dart | 7 +++++++ 6 files changed, 43 insertions(+) diff --git a/lib/data/friendly_error.dart b/lib/data/friendly_error.dart index ba2416f..a7026b3 100644 --- a/lib/data/friendly_error.dart +++ b/lib/data/friendly_error.dart @@ -122,6 +122,19 @@ FriendlyError friendlyError(Object error, AppLocalizations l) { FriendlyError? _matchHubPattern(String detail, AppLocalizations l) { if (detail.isEmpty) return null; + // Module bundle download failed (bad / unhosted URL). The hub wraps + // these as "download failed: ..." and (older builds) mapped them to + // gRPC Unavailable — which the code-default would render as the + // misleading "hub not reachable". The hub is fine; show the real URL + // + status (carried in `detail`) under a clear headline. + if (detail.contains('download failed') || detail.contains('download error')) { + return FriendlyError( + headline: l.errModuleDownload, + detail: detail, + hint: l.errModuleDownloadHint, + ); + } + // Approval rejected: "step 'X' rejected by Y: reason" if (detail.contains('rejected by')) { return FriendlyError( diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 1c54747..bad06e9 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -1,5 +1,7 @@ { "@@locale": "de", + "errModuleDownload": "Modul-Download fehlgeschlagen", + "errModuleDownloadHint": "Die Bundle-URL des Moduls ist nicht erreichbar (Statuscode unten). Der Hub läuft — URL/Host korrigieren oder anderen Store wählen.", "guidedSetupTitle": "Setup-Assistent", "guidedSetupIntro": "Beantworte drei Fragen — Ch∆In stellt passende Konfiguration, Modul-Set und Start-Flow zusammen.", "guidedSetupScenario": "Szenario", diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 55a1b58..8ac4f2b 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -1,5 +1,7 @@ { "@@locale": "en", + "errModuleDownload": "Module download failed", + "errModuleDownloadHint": "The module's bundle URL is unreachable (status code below). The hub is running fine — fix the URL/host or choose another store.", "guidedSetupTitle": "Setup assistant", "guidedSetupIntro": "Answer three questions and Ch∆In assembles a tailored config, module set and starter flow.", "guidedSetupScenario": "Scenario", diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 31a683d..61235dd 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -98,6 +98,18 @@ abstract class AppLocalizations { Locale('en'), ]; + /// No description provided for @errModuleDownload. + /// + /// In en, this message translates to: + /// **'Module download failed'** + String get errModuleDownload; + + /// No description provided for @errModuleDownloadHint. + /// + /// In en, this message translates to: + /// **'The module\'s bundle URL is unreachable (status code below). The hub is running fine — fix the URL/host or choose another store.'** + String get errModuleDownloadHint; + /// No description provided for @guidedSetupTitle. /// /// In en, this message translates to: diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart index 4c037c9..acf8b10 100644 --- a/lib/l10n/app_localizations_de.dart +++ b/lib/l10n/app_localizations_de.dart @@ -8,6 +8,13 @@ import 'app_localizations.dart'; class AppLocalizationsDe extends AppLocalizations { AppLocalizationsDe([String locale = 'de']) : super(locale); + @override + String get errModuleDownload => 'Modul-Download fehlgeschlagen'; + + @override + String get errModuleDownloadHint => + 'Die Bundle-URL des Moduls ist nicht erreichbar (Statuscode unten). Der Hub läuft — URL/Host korrigieren oder anderen Store wählen.'; + @override String get guidedSetupTitle => 'Setup-Assistent'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 55b0a43..615cd53 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -8,6 +8,13 @@ import 'app_localizations.dart'; class AppLocalizationsEn extends AppLocalizations { AppLocalizationsEn([String locale = 'en']) : super(locale); + @override + String get errModuleDownload => 'Module download failed'; + + @override + String get errModuleDownloadHint => + 'The module\'s bundle URL is unreachable (status code below). The hub is running fine — fix the URL/host or choose another store.'; + @override String get guidedSetupTitle => 'Setup assistant';