GitHosts: Throw RepoExists exception

This commit is contained in:
Vishesh Handa
2019-01-25 15:11:09 +01:00
parent 86f01ab7d1
commit 8e9e3a91b5
2 changed files with 9 additions and 4 deletions

View File

@ -124,6 +124,12 @@ class GitHub implements GitHost {
": " +
response.body);
if (response.statusCode == 422) {
if (response.body.contains("name already exists")) {
throw GitHostException.RepoExists;
}
}
throw GitHostException.CreateRepoFailed;
}