diff options
author | Andreas Fischer <bantu@phpbb.com> | 2015-01-30 19:00:15 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2015-01-30 19:00:15 +0100 |
commit | 2690038d404779a71ee81f36416886f63414d582 (patch) | |
tree | ecfc16891c16a8ab4afa67442739a67dd8e71145 /phpBB | |
parent | 3e710fe393ddb7067a1dc28440792d18e2d416d5 (diff) | |
parent | 3fef570950e27c9a60bcc57ef176d1d257a194bd (diff) | |
download | forums-2690038d404779a71ee81f36416886f63414d582.tar forums-2690038d404779a71ee81f36416886f63414d582.tar.gz forums-2690038d404779a71ee81f36416886f63414d582.tar.bz2 forums-2690038d404779a71ee81f36416886f63414d582.tar.xz forums-2690038d404779a71ee81f36416886f63414d582.zip |
Merge branch 'prep-release-3.1.3' into develop-ascraeus
* prep-release-3.1.3:
[ticket/13556] Fix exception translation with filedownloader
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/phpbb/file_downloader.php | 6 | ||||
-rw-r--r-- | phpBB/phpbb/version_helper.php | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php index d717b394d5..ca8b1f4534 100644 --- a/phpBB/phpbb/file_downloader.php +++ b/phpBB/phpbb/file_downloader.php @@ -33,7 +33,7 @@ class file_downloader * @return mixed File data as string if file can be read and there is no * timeout, false if there were errors or the connection timed out * - * @throws \RuntimeException If data can't be retrieved and no error + * @throws \phpbb\exception\runtime_exception If data can't be retrieved and no error * message is returned */ public function get($host, $directory, $filename, $port = 80, $timeout = 6) @@ -69,7 +69,7 @@ class file_downloader } else if (stripos($line, '404 not found') !== false) { - throw new \RuntimeException(array('FILE_NOT_FOUND', $filename)); + throw new \phpbb\exception\runtime_exception('FILE_NOT_FOUND', array($filename)); } } @@ -77,7 +77,7 @@ class file_downloader if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop) { - throw new \RuntimeException('FSOCK_TIMEOUT'); + throw new \phpbb\exception\runtime_exception('FSOCK_TIMEOUT'); } } @fclose($socket); diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php index dc62f06fb2..e4f68f5aab 100644 --- a/phpBB/phpbb/version_helper.php +++ b/phpBB/phpbb/version_helper.php @@ -257,9 +257,10 @@ class version_helper try { $info = $this->file_downloader->get($this->host, $this->path, $this->file); } - catch (\RuntimeException $exception) + catch (\phpbb\exception\runtime_exception $exception) { - throw new \RuntimeException($this->user->lang($exception->getMessage())); + $prepare_parameters = array_merge(array($exception->getMessage()), $exception->get_parameters()); + throw new \RuntimeException(call_user_func_array(array($this->user, 'lang'), $prepare_parameters)); } $error_string = $this->file_downloader->get_error_string(); |