File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,19 @@ class _AddAccountPageState extends State<AddAccountPage> {
147
147
_inProgress = true ;
148
148
});
149
149
try {
150
- final serverSettings = await getServerSettings (realmUrl: url! );
150
+ final GetServerSettingsResult serverSettings;
151
+ try {
152
+ serverSettings = await getServerSettings (realmUrl: url! );
153
+ } catch (e) {
154
+ if (! context.mounted) {
155
+ return ;
156
+ }
157
+ // TODO(#35) give more helpful feedback; see `fetchServerSettings`
158
+ // in zulip-mobile's src/message/fetchActions.js. Needs #37.
159
+ showErrorDialog (context: context,
160
+ title: 'Could not connect' , message: 'Failed to connect to server:\n $url ' );
161
+ return ;
162
+ }
151
163
// https://github.com/dart-lang/linter/issues/4007
152
164
// ignore: use_build_context_synchronously
153
165
if (! context.mounted) {
You can’t perform that action at this time.
0 commit comments