1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-21 00:02:18 +02:00

[ticket/17480] Properly catch RuntimeException if no http handler is available

PHPBB-17480
This commit is contained in:
rxu 2025-03-04 09:53:19 +07:00
parent d8aa6873b2
commit 9bdb88879d
No known key found for this signature in database
GPG Key ID: 8117904FEDEFDD17

View File

@ -75,8 +75,15 @@ class file_downloader
*/
public function get(string $host, string $directory, string $filename, int $port = 443, int $timeout = 6)
{
// Initialize Guzzle client
$client = $this->create_client($host, $port, $timeout);
try
{
// Initialize Guzzle client
$client = $this->create_client($host, $port, $timeout);
}
catch (\RuntimeException $exception)
{
throw new runtime_exception($exception->getMessage());
}
// Set default values for error variables
$this->error_number = 0;