confluent-cli icon indicating copy to clipboard operation
confluent-cli copied to clipboard

Fix parsing of error message when html is returned instead of json.

Open kkonstantine opened this issue 8 years ago • 0 comments

When an error code and message is returned by Jetty in html format rather than the Kafka Connect framework in json format, jq is unable to parse the returned message and instead it prints a very unintuitive message such as:

parse error: Invalid numeric literal at line 2, column 0

for an error message such as:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /connectors. Reason:
<pre>    Request failed.</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

Confluent CLI should be able to distinguish between the two error messages and print the root cause in all cases.

kkonstantine avatar Oct 02 '17 22:10 kkonstantine