From d19769415f7f8a17f5f6c22eedea73df50bff847 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Mon, 7 Aug 2023 21:09:51 +0530 Subject: [PATCH] Throw exception from createRepo --- app/controllers/api/vcs.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 8477478b5f..648653b870 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -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.';