mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix: guard repository creation behind the adapter capability
Origin's createRepository() throws in utopia-php/vcs 5.2.0; asking supportsRepositoryCreation() first turns that into a clear client error instead of an uncaught provider exception. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b78dd45e4
commit
194b8e5cef
1 file changed
+5
@@ -112,6 +112,11 @@ class Create extends Action
|
||||
} else {
|
||||
$providerInstallationId = $installation->getAttribute('providerInstallationId');
|
||||
$vcs = $vcsFactory->fromInstallation($installation);
|
||||
|
||||
if (!$vcs->supportsRepositoryCreation()) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'VCS provider does not support repository creation: ' . $provider);
|
||||
}
|
||||
|
||||
$owner = !empty($providerNamespace) ? $providerNamespace : $vcs->getOwnerName($providerInstallationId);
|
||||
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user