diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 3de293b7f7c..8ffd763817b 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -764,6 +764,16 @@ "@could_not_refresh": { "description": "The product data couldn't be refreshed" }, + "product_internet_error_modal_title": "An error has occurred!", + "product_internet_error_modal_message": "We are unable to fetch information about this product due to a network error. Please check your internet connection and try again.\n\nInternal error:\n{error}", + "@product_internet_error_modal_message": { + "placeholders": { + "error": { + "type": "String", + "description": "The error message" + } + } + }, "product_internet_error": "Impossible to fetch information about this product due to a network error.", "cached_results_from": "Show results from:", "@cached_results_from": { diff --git a/packages/smooth_app/lib/pages/product/common/product_dialog_helper.dart b/packages/smooth_app/lib/pages/product/common/product_dialog_helper.dart index 96e19267041..cc2d0f9f994 100644 --- a/packages/smooth_app/lib/pages/product/common/product_dialog_helper.dart +++ b/packages/smooth_app/lib/pages/product/common/product_dialog_helper.dart @@ -167,13 +167,18 @@ class ProductDialogHelper { void _openErrorMessage(final String message) => showDialog( context: context, - builder: (BuildContext context) => SmoothAlertDialog( - body: getErrorMessage(message), - positiveAction: SmoothActionButton( - text: AppLocalizations.of(context).close, - onPressed: () => Navigator.pop(context), - ), - ), + builder: (BuildContext context) { + final AppLocalizations localizations = AppLocalizations.of(context); + + return SmoothAlertDialog( + title: localizations.product_internet_error_modal_title, + body: getErrorMessage(message), + positiveAction: SmoothActionButton( + text: localizations.close, + onPressed: () => Navigator.pop(context), + ), + ); + }, ); /// Opens an error dialog; to be used only if the status is not ok. @@ -185,7 +190,10 @@ class ProductDialogHelper { case FetchedProductStatus.userCancelled: return; case FetchedProductStatus.internetError: - _openErrorMessage(appLocalizations.product_internet_error); + _openErrorMessage( + appLocalizations.product_internet_error_modal_message( + fetchedProduct.exceptionString ?? '-'), + ); return; case FetchedProductStatus.internetNotFound: _openProductNotFoundDialog();