When there is a error code returned by a WS, the scanner tries to parse a JSON message out of it. If no such message is found, it dumps into the logs the entire body of the response.
This can be a very long and useless HTML content:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project polyforms: Failed to upload report - 502: <!DOCTYPE html>
[ERROR] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
[ERROR] <meta http-equiv="X-UA-Compatible" content="IE=edge">
[ERROR] <meta name="robots" content="index, follow">
[ERROR] <title>Server Error - Peach</title>
[ERROR] <link rel="shortcut icon" type="image/ico" href="data:image/x-icon;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
(continues, it can be really long...)
We should either limit the length of this response, or detect that it's HTML content and not display anything at all.