From c511a1b7efe95b0206446a2a1385fce8561f638f Mon Sep 17 00:00:00 2001 From: Jakub Ledwon Date: Thu, 16 Jan 2025 18:19:13 +0100 Subject: [PATCH 1/2] fix: add underlyingException to FirebaseJsonException when projectId or appId are missing --- .../flutterfire_cli/lib/src/commands/upload_symbols.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/flutterfire_cli/lib/src/commands/upload_symbols.dart b/packages/flutterfire_cli/lib/src/commands/upload_symbols.dart index c571e862..30a3e7d5 100644 --- a/packages/flutterfire_cli/lib/src/commands/upload_symbols.dart +++ b/packages/flutterfire_cli/lib/src/commands/upload_symbols.dart @@ -313,7 +313,10 @@ class UploadCrashlyticsSymbols extends FlutterFireCommand { } if (projectId == null || appId == null) { - throw FirebaseJsonException(); + final underlyingException = + projectId == null ? 'projectId is missing.' : 'appId is missing.'; + + throw FirebaseJsonException(underlyingException: underlyingException); } return ConfigurationResults( From a7b0a4fd41d8613701a9039de903bd6fcd1244e0 Mon Sep 17 00:00:00 2001 From: Jakub Ledwon Date: Thu, 16 Jan 2025 18:27:34 +0100 Subject: [PATCH 2/2] fix: ensure that underlyingException is printed when it's present --- packages/flutterfire_cli/lib/src/common/strings.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutterfire_cli/lib/src/common/strings.dart b/packages/flutterfire_cli/lib/src/common/strings.dart index 2ad2a988..287e9a9d 100644 --- a/packages/flutterfire_cli/lib/src/common/strings.dart +++ b/packages/flutterfire_cli/lib/src/common/strings.dart @@ -136,7 +136,7 @@ class FirebaseJsonException implements FlutterFireException { final String? underlyingException; @override String toString() { - return 'FirebaseJsonException: Please run "flutterfire configure" to update the `firebase.json` at the root of your Flutter project with correct values. ${underlyingException != null ? '' : underlyingException}'; + return 'FirebaseJsonException: Please run "flutterfire configure" to update the `firebase.json` at the root of your Flutter project with correct values. ${underlyingException ?? ''}'; } }