mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 03:19:11 +08:00
GitHost AutoConfigure: Show the error
It looks super ugly, but it's better than not showing anything.
This commit is contained in:
@ -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();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user