diff --git a/src/FetchManager.php b/src/FetchManager.php index 85b4c8c..f972426 100644 --- a/src/FetchManager.php +++ b/src/FetchManager.php @@ -58,9 +58,9 @@ class FetchManager implements FetchManagerInterface { * {@inheritdoc} */ public function fetch($server, $remote_file_dir, $relative_path, array $options) { + $url = $server . '/' . UrlHelper::encodePath($remote_file_dir . '/' . $relative_path); try { // Fetch remote file. - $url = $server . '/' . UrlHelper::encodePath($remote_file_dir . '/' . $relative_path); $options['Connection'] = 'close'; $response = $this->client->get($url, $options); @@ -101,10 +101,13 @@ class FetchManager implements FetchManagerInterface { return FALSE; } catch (GuzzleException $e) { - // Do nothing. + watchdog_exception( + 'stage_file_proxy', + $e, + 'Stage File Proxy encountered an error when retrieving file @url. @message in %function (line %line of %file).', + ['@url' => $url]); + return FALSE; } - $this->logger->error('Stage File Proxy encountered an unknown error by retrieving file @file', ['@file' => $server . '/' . UrlHelper::encodePath($remote_file_dir . '/' . $relative_path)]); - return FALSE; } /**