Skip to content

Commit 9bdb888

Browse files
committed
[ticket/17480] Properly catch RuntimeException if no http handler is available
PHPBB-17480
1 parent d8aa687 commit 9bdb888

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

phpBB/phpbb/file_downloader.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,15 @@ protected function create_client(string $host, int $port = 443, int $timeout = 6
7575
*/
7676
public function get(string $host, string $directory, string $filename, int $port = 443, int $timeout = 6)
7777
{
78-
// Initialize Guzzle client
79-
$client = $this->create_client($host, $port, $timeout);
78+
try
79+
{
80+
// Initialize Guzzle client
81+
$client = $this->create_client($host, $port, $timeout);
82+
}
83+
catch (\RuntimeException $exception)
84+
{
85+
throw new runtime_exception($exception->getMessage());
86+
}
8087

8188
// Set default values for error variables
8289
$this->error_number = 0;

0 commit comments

Comments
 (0)