chg: [internal] Log content type when JSON could not be parsed

pull/9639/head
Jakub Onderka 2024-03-24 18:46:02 +01:00
parent c946d7c451
commit 5b11e6b212
1 changed files with 2 additions and 1 deletions

View File

@ -121,7 +121,8 @@ class HttpSocketResponseExtended extends HttpSocketResponse
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);
}
}
}