diff --git a/app/Lib/Tools/HttpSocketExtended.php b/app/Lib/Tools/HttpSocketExtended.php index cfe097c2861..051c0ae60c4 100644 --- a/app/Lib/Tools/HttpSocketExtended.php +++ b/app/Lib/Tools/HttpSocketExtended.php @@ -121,7 +121,8 @@ public function json() try { return JsonTool::decode($this->body); } catch (Exception $e) { - throw new HttpSocketJsonException('Could not parse response as JSON.', $this, $e); + $contentType = $this->getHeader('content-type'); + throw new HttpSocketJsonException("Could not parse HTTP response as JSON. Received Content-Type $contentType.", $this, $e); } } }