mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
updated error message
This commit is contained in:
1 parent
f9da8e4524
commit
c15db72879
1 file changed
+14
-9
@@ -65,17 +65,22 @@ function getDatabaseResourceType(string $databaseType): string
|
||||
|
||||
function throwMigrationReportProviderException(\Throwable $e): void
|
||||
{
|
||||
if ($e->getCode() === 403) {
|
||||
throw new Exception(
|
||||
Exception::MIGRATION_PROVIDER_ERROR,
|
||||
$e->getMessage() !== '' ? $e->getMessage() : 'Missing required scopes.'
|
||||
);
|
||||
$defaultConnectivity = 'Unable to connect to the migration source. Please verify your credentials and ensure the source is reachable from this server. Check for network restrictions such as firewalls, IP allowlists, or outbound connectivity limits.';
|
||||
|
||||
for ($cur = $e; $cur !== null; $cur = $cur->getPrevious()) {
|
||||
if (! $cur instanceof \Appwrite\AppwriteException) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((int) $cur->getCode() === 401 && $cur->getType() === Exception::GENERAL_UNAUTHORIZED_SCOPE) {
|
||||
throw new Exception(
|
||||
Exception::GENERAL_UNAUTHORIZED_SCOPE,
|
||||
$cur->getMessage() !== '' ? $cur->getMessage() : null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception(
|
||||
Exception::MIGRATION_PROVIDER_ERROR,
|
||||
'Unable to connect to the migration source. Please verify your credentials and ensure the source is reachable from this server. Check for network restrictions such as firewalls, IP allowlists, or outbound connectivity limits.'
|
||||
);
|
||||
throw new Exception(Exception::MIGRATION_PROVIDER_ERROR, $defaultConnectivity);
|
||||
}
|
||||
|
||||
Http::post('/v1/migrations/appwrite')
|
||||
|
||||
Reference in new issue
Block a user