From 4b5b5f4ae387f3da04e99fa18855d1f5a0bc1de9 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 16 Nov 2014 15:37:52 +0100 Subject: [PATCH] Livestatus\Query: use trigger_error in __toString --- library/Icinga/Protocol/Livestatus/Query.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/Livestatus/Query.php b/library/Icinga/Protocol/Livestatus/Query.php index fea9df029..2de9b8b19 100644 --- a/library/Icinga/Protocol/Livestatus/Query.php +++ b/library/Icinga/Protocol/Livestatus/Query.php @@ -12,6 +12,7 @@ use Icinga\Data\Filter\FilterExpression; use Icinga\Data\Filter\FilterOr; use Icinga\Data\Filter\FilterAnd; use Icinga\Data\Filter\FilterNot; +use Exception; class Query extends SimpleQuery { @@ -75,7 +76,11 @@ class Query extends SimpleQuery */ public function __toString() { - return $this->toString(); + try { + return $this->toString(); + } catch (Exception $e) { + trigger_error('Exception: ' . $e->getMessage(), E_USER_ERROR); + } } /**