mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 00:04:04 +02:00
Macro: Log the object where a macro is not found
fixes #3759 (cherry picked from commit dae7bf4657895ba1283cdd56c1a7d7c836681aa3)
This commit is contained in:
parent
667570b810
commit
28f66a4aff
@ -68,8 +68,13 @@ class Macro
|
||||
try {
|
||||
$value = $object->$macro;
|
||||
} catch (Exception $e) {
|
||||
$objectName = $object->getName();
|
||||
if ($object instanceof Service) {
|
||||
$objectName = $object->getHost()->getName() . '!' . $objectName;
|
||||
}
|
||||
|
||||
$value = null;
|
||||
Logger::debug('Unable to resolve macro "%s". An error occured: %s', $macro, $e);
|
||||
Logger::debug('Unable to resolve macro "%s" on object "%s". An error occured: %s', $macro, $objectName, $e);
|
||||
}
|
||||
|
||||
return $value !== null ? $value : $macro;
|
||||
|
Loading…
x
Reference in New Issue
Block a user