mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
refactor: update migration exception handling and return type
This commit is contained in:
1 parent
c15db72879
commit
f1d41b8ff3
1 file changed
+3
-3
@@ -63,7 +63,7 @@ function getDatabaseResourceType(string $databaseType): string
|
||||
};
|
||||
}
|
||||
|
||||
function throwMigrationReportProviderException(\Throwable $e): void
|
||||
function throwMigrationReportProviderException(\Throwable $e): never
|
||||
{
|
||||
$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.';
|
||||
|
||||
@@ -72,9 +72,9 @@ function throwMigrationReportProviderException(\Throwable $e): void
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((int) $cur->getCode() === 401 && $cur->getType() === Exception::GENERAL_UNAUTHORIZED_SCOPE) {
|
||||
if ((int) $cur->getCode() >= 400 && (int) $cur->getCode() < 500) {
|
||||
throw new Exception(
|
||||
Exception::GENERAL_UNAUTHORIZED_SCOPE,
|
||||
Exception::MIGRATION_PROVIDER_ERROR,
|
||||
$cur->getMessage() !== '' ? $cur->getMessage() : null
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user