Commit 17e18270 authored by catch's avatar catch

Issue #2362403 by tstoeckler: Fatal error during multilingual installation when network goes away

parent 468646e3
......@@ -247,17 +247,18 @@ function locale_translation_http_check($uri) {
}
catch (RequestException $e) {
// Handle 4xx and 5xx http responses.
$response = $e->getResponse();
if ($response->getStatusCode() == 404) {
// File not found occurs when a translation file is not yet available
// at the translation server. But also if a custom module or custom
// theme does not define the location of a translation file. By default
// the file is checked at the translation server, but it will not be
// found there.
$logger->notice('Translation file not found: @uri.', array('@uri' => $uri));
return TRUE;
if ($response = $e->getResponse()) {
if ($response->getStatusCode() == 404) {
// File not found occurs when a translation file is not yet available
// at the translation server. But also if a custom module or custom
// theme does not define the location of a translation file. By default
// the file is checked at the translation server, but it will not be
// found there.
$logger->notice('Translation file not found: @uri.', array('@uri' => $uri));
return TRUE;
}
$logger->notice('HTTP request to @url failed with error: @error.', array('@url' => $uri, '@error' => $response->getStatusCode() . ' ' . $response->getReasonPhrase()));
}
$logger->notice('HTTP request to @url failed with error: @error.', array('@url' => $uri, '@error' => $response->getStatusCode() . ' ' . $response->getReasonPhrase()));
}
return FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment