mirror of https://github.com/MISP/MISP
chg: [internal] Log content type when JSON could not be parsed
parent
c946d7c451
commit
5b11e6b212
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue