Throw exception from createRepo

This commit is contained in:
Khushboo Verma
2023-08-07 21:09:51 +05:30
parent 11068696c9
commit d19769415f
+4
View File
@@ -672,6 +672,10 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories')
$repository = $github->createRepository($owner, $name, $private);
}
if (isset($repository['message'])) {
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Provider Error: ' . $repository['message']);
}
if (isset($repository['errors'])) {
$message = $repository['message'] ?? 'Unknown error.';