Remove code duplication

This commit is contained in:
Vishesh Handa
2019-08-21 17:30:02 +02:00
parent e98262b5ba
commit 356771fed1

View File

@ -89,22 +89,18 @@ class GitHostSetupAutoConfigureState extends State<GitHostSetupAutoConfigure> {
}
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: <String, dynamic>{
'errorMessage': errorMessage,
},
);
});
_handleGitHostException(e);
return;
}
widget.onDone(repo.cloneUrl);
});
gitHost.launchOAuthScreen();
} on GitHostException catch (e) {
_handleGitHostException(e);
}
}
void _handleGitHostException(GitHostException e) {
Fimber.d("GitHostSetupAutoConfigure: " + e.toString());
setState(() {
errorMessage = widget.gitHostType.toString() + ": " + e.toString();
@ -116,7 +112,6 @@ class GitHostSetupAutoConfigureState extends State<GitHostSetupAutoConfigure> {
);
});
}
}
@override
Widget build(BuildContext context) {