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 <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-06-22 00:50:21 +02:00
parent c9fa068991
commit 657e68efee
6 changed files with 43 additions and 0 deletions

View file

@ -122,6 +122,19 @@ FriendlyError friendlyError(Object error, AppLocalizations l) {
FriendlyError? _matchHubPattern(String detail, AppLocalizations l) { FriendlyError? _matchHubPattern(String detail, AppLocalizations l) {
if (detail.isEmpty) return null; 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" // Approval rejected: "step 'X' rejected by Y: reason"
if (detail.contains('rejected by')) { if (detail.contains('rejected by')) {
return FriendlyError( return FriendlyError(

View file

@ -1,5 +1,7 @@
{ {
"@@locale": "de", "@@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", "guidedSetupTitle": "Setup-Assistent",
"guidedSetupIntro": "Beantworte drei Fragen — Ch∆In stellt passende Konfiguration, Modul-Set und Start-Flow zusammen.", "guidedSetupIntro": "Beantworte drei Fragen — Ch∆In stellt passende Konfiguration, Modul-Set und Start-Flow zusammen.",
"guidedSetupScenario": "Szenario", "guidedSetupScenario": "Szenario",

View file

@ -1,5 +1,7 @@
{ {
"@@locale": "en", "@@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", "guidedSetupTitle": "Setup assistant",
"guidedSetupIntro": "Answer three questions and Ch∆In assembles a tailored config, module set and starter flow.", "guidedSetupIntro": "Answer three questions and Ch∆In assembles a tailored config, module set and starter flow.",
"guidedSetupScenario": "Scenario", "guidedSetupScenario": "Scenario",

View file

@ -98,6 +98,18 @@ abstract class AppLocalizations {
Locale('en'), 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. /// No description provided for @guidedSetupTitle.
/// ///
/// In en, this message translates to: /// In en, this message translates to:

View file

@ -8,6 +8,13 @@ import 'app_localizations.dart';
class AppLocalizationsDe extends AppLocalizations { class AppLocalizationsDe extends AppLocalizations {
AppLocalizationsDe([String locale = 'de']) : super(locale); 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 @override
String get guidedSetupTitle => 'Setup-Assistent'; String get guidedSetupTitle => 'Setup-Assistent';

View file

@ -8,6 +8,13 @@ import 'app_localizations.dart';
class AppLocalizationsEn extends AppLocalizations { class AppLocalizationsEn extends AppLocalizations {
AppLocalizationsEn([String locale = 'en']) : super(locale); 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 @override
String get guidedSetupTitle => 'Setup assistant'; String get guidedSetupTitle => 'Setup assistant';