[CORE] Fix logging of very early failures
This commit is contained in:
parent
4afaad3df5
commit
1f2f57b03b
@ -1417,14 +1417,14 @@ function common_path($relative, $ssl=false, $addSession=true)
|
|||||||
} elseif (common_config('site', 'server')) {
|
} elseif (common_config('site', 'server')) {
|
||||||
$serverpart = common_config('site', 'server');
|
$serverpart = common_config('site', 'server');
|
||||||
} else {
|
} else {
|
||||||
common_log(LOG_ERR, 'Site server not configured, unable to determine site name.');
|
throw new ServerException('Site server not configured, unable to determine site name.');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$proto = 'http';
|
$proto = 'http';
|
||||||
if (common_config('site', 'server')) {
|
if (common_config('site', 'server')) {
|
||||||
$serverpart = common_config('site', 'server');
|
$serverpart = common_config('site', 'server');
|
||||||
} else {
|
} else {
|
||||||
common_log(LOG_ERR, 'Site server not configured, unable to determine site name.');
|
throw new ServerException('Site server not configured, unable to determine site name.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2151,6 +2151,9 @@ function common_negotiate_type($cprefs, $sprefs)
|
|||||||
function common_config($main, $sub=null)
|
function common_config($main, $sub=null)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
if (is_null($config)) {
|
||||||
|
throw new ServerException('common_config was invoked before config.php was read');
|
||||||
|
}
|
||||||
if (is_null($sub)) {
|
if (is_null($sub)) {
|
||||||
// Return the config category array
|
// Return the config category array
|
||||||
return array_key_exists($main, $config) ? $config[$main] : [];
|
return array_key_exists($main, $config) ? $config[$main] : [];
|
||||||
|
@ -156,6 +156,7 @@ function handleError($error)
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
// TRANS: Error message.
|
// TRANS: Error message.
|
||||||
echo _('An error occurred.');
|
echo _('An error occurred.');
|
||||||
|
error_log('Uncaught Exception: ' . $error);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user