diff --git a/lib/screens/githostsetup_autoconfigure.dart b/lib/screens/githostsetup_autoconfigure.dart index 87b1119f..49021eff 100644 --- a/lib/screens/githostsetup_autoconfigure.dart +++ b/lib/screens/githostsetup_autoconfigure.dart @@ -89,35 +89,30 @@ class GitHostSetupAutoConfigureState extends State { } Settings.instance.save(); } on GitHostException catch (e) { - Fimber.d("GitHostSetupAutoConfigure: " + e.toString()); - setState(() { - errorMessage = widget.gitHostType.toString() + ": " + e.toString(); - getAnalytics().logEvent( - name: "githostsetup_error", - parameters: { - 'errorMessage': errorMessage, - }, - ); - }); + _handleGitHostException(e); return; } widget.onDone(repo.cloneUrl); }); gitHost.launchOAuthScreen(); } on GitHostException catch (e) { - Fimber.d("GitHostSetupAutoConfigure: " + e.toString()); - setState(() { - errorMessage = widget.gitHostType.toString() + ": " + e.toString(); - getAnalytics().logEvent( - name: "githostsetup_error", - parameters: { - 'errorMessage': errorMessage, - }, - ); - }); + _handleGitHostException(e); } } + void _handleGitHostException(GitHostException e) { + Fimber.d("GitHostSetupAutoConfigure: " + e.toString()); + setState(() { + errorMessage = widget.gitHostType.toString() + ": " + e.toString(); + getAnalytics().logEvent( + name: "githostsetup_error", + parameters: { + 'errorMessage': errorMessage, + }, + ); + }); + } + @override Widget build(BuildContext context) { if (_configuringStarted) {