mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Address error validation comment
This commit is contained in:
+5
-1
@@ -336,5 +336,9 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo
|
||||
}
|
||||
});
|
||||
|
||||
Method::finaliseInitialization();
|
||||
// Check for any errors found while we were initialising the SDK Methods.
|
||||
if (!empty(Method::getErrors())) {
|
||||
throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors()));
|
||||
}
|
||||
|
||||
$http->start();
|
||||
|
||||
@@ -309,11 +309,8 @@ class Method
|
||||
return $this;
|
||||
}
|
||||
|
||||
// Throw any errors that were found during initialization
|
||||
public static function finaliseInitialization(): void
|
||||
public static function getErrors(): array
|
||||
{
|
||||
if (!empty(self::$errors)) {
|
||||
throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$errors));
|
||||
}
|
||||
return self::$errors;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user