Skip to content

Commit

Permalink
chg: [internal] Log content type when JSON could not be parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubOnderka committed Mar 24, 2024
1 parent c946d7c commit 5b11e6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Lib/Tools/HttpSocketExtended.php
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 5b11e6b

Please sign in to comment.