GitHost AutoConfigure: Show the error

It looks super ugly, but it's better than not showing anything.
This commit is contained in:
Vishesh Handa
2019-01-25 15:11:24 +01:00
parent 8e9e3a91b5
commit d6515bf507

View File

@ -31,15 +31,22 @@ class GitHostSetupAutoConfigureState extends State<GitHostSetupAutoConfigure> {
gitHost.init(() async { gitHost.init(() async {
print("GitHost Initalized: " + widget.gitHostType.toString()); print("GitHost Initalized: " + widget.gitHostType.toString());
var repo = await gitHost.createRepo("journal"); GitRepo repo;
try {
repo = await gitHost.createRepo("journal");
var publicKey = await generateSSHKeys(comment: "GitJournal"); var publicKey = await generateSSHKeys(comment: "GitJournal");
await gitHost.addDeployKey(publicKey, repo.fullName); await gitHost.addDeployKey(publicKey, repo.fullName);
} on GitHostException catch (e) {
print("GitHostSetupAutoConfigure: " + e.toString());
setState(() {
errorMessage = widget.gitHostType.toString() + ": " + e.toString();
});
}
widget.onDone(repo.cloneUrl); widget.onDone(repo.cloneUrl);
}); });
gitHost.launchOAuthScreen(); gitHost.launchOAuthScreen();
} on GitHostException catch (e) { } on GitHostException catch (e) {
print("GitHostSetupAutoConfigur: " + e.toString()); print("GitHostSetupAutoConfigure: " + e.toString());
setState(() { setState(() {
errorMessage = widget.gitHostType.toString() + ": " + e.toString(); errorMessage = widget.gitHostType.toString() + ": " + e.toString();
}); });