mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Logger: Fix substitution of exception messages
This commit is contained in:
parent
f93c2de6be
commit
0a387573f3
@ -243,7 +243,9 @@ class Logger
|
||||
return vsprintf(
|
||||
array_shift($arguments),
|
||||
array_map(
|
||||
function ($a) { return is_string($a) ? $a : json_encode($a); },
|
||||
function ($a) {
|
||||
return is_string($a) ? $a : ($a instanceof Exception ? $a->getMessage() : json_encode($a));
|
||||
},
|
||||
$arguments
|
||||
)
|
||||
);
|
||||
|
@ -56,7 +56,7 @@ class Manager
|
||||
} catch (NotReadableError $e) {
|
||||
Logger::error(
|
||||
new IcingaException(
|
||||
'Cannot load preferences for user "%s". An exception was thrown',
|
||||
'Cannot load preferences for user "%s". An exception was thrown: %s',
|
||||
$username,
|
||||
$e
|
||||
)
|
||||
@ -74,7 +74,7 @@ class Manager
|
||||
} catch (NotReadableError $e) {
|
||||
Logger::error(
|
||||
new IcingaException(
|
||||
'Cannot load preferences for user "%s". An exception was thrown',
|
||||
'Cannot load preferences for user "%s". An exception was thrown: %s',
|
||||
$username,
|
||||
$e
|
||||
)
|
||||
@ -92,7 +92,7 @@ class Manager
|
||||
$groupsFromBackend = $groupBackend->getMemberships($user);
|
||||
} catch (Exception $e) {
|
||||
Logger::error(
|
||||
'Can\'t get group memberships for user \'%s\' from backend \'%s\'. An exception was thrown:',
|
||||
'Can\'t get group memberships for user \'%s\' from backend \'%s\'. An exception was thrown: %s',
|
||||
$username,
|
||||
$name,
|
||||
$e
|
||||
|
Loading…
x
Reference in New Issue
Block a user