From 34a38e1f324d771481012e771647a712b0c15346 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 22 Sep 2019 17:07:22 +0200 Subject: [PATCH] RestApiRespons: show part of the result on parse... ...errors --- library/Director/Core/RestApiResponse.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Director/Core/RestApiResponse.php b/library/Director/Core/RestApiResponse.php index e15799cc..523ed35b 100644 --- a/library/Director/Core/RestApiResponse.php +++ b/library/Director/Core/RestApiResponse.php @@ -98,7 +98,12 @@ class RestApiResponse $result = @json_decode($json); if ($result === null) { $this->setJsonError(); - throw new IcingaException('Parsing JSON result failed: ' . $this->errorMessage); + //

Bad Request

bad version

+ throw new IcingaException( + 'Parsing JSON result failed: ' + . $this->errorMessage + . ' (Got: ' . substr($json, 0, 60) . ')' + ); } if (property_exists($result, 'error')) { if (property_exists($result, 'status')) {