Skip to content

Commit 28ee3b0

Browse files
committed
login: Show error dialog on get-server-settings failure
Fixes-partly: zulip#35
1 parent fdd6832 commit 28ee3b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/widgets/login.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ class _AddAccountPageState extends State<AddAccountPage> {
146146
});
147147
try {
148148
serverSettings = await getServerSettings(realmUrl: url!);
149-
// TODO(#35) report errors
149+
} catch (e) {
150+
if (!context.mounted) return;
151+
// TODO(#35) give more helpful feedback; see `fetchServerSettings`
152+
// in zulip-mobile's src/message/fetchActions.js. Needs #37.
153+
showErrorDialog(context: context,
154+
title: 'Could not connect', message: 'Failed to connect to server: $url');
155+
return;
150156
} finally {
151157
setState(() {
152158
_inProgress = false;

0 commit comments

Comments
 (0)