diff --git a/src/main/java/com/manolodominguez/openlrae/cli/CLIHandler.java b/src/main/java/com/manolodominguez/openlrae/cli/CLIHandler.java index edffa56..fa7251b 100644 --- a/src/main/java/com/manolodominguez/openlrae/cli/CLIHandler.java +++ b/src/main/java/com/manolodominguez/openlrae/cli/CLIHandler.java @@ -61,6 +61,7 @@ import java.net.URL; import java.util.Locale; import java.util.ResourceBundle; +import org.json.JSONException; import org.slf4j.LoggerFactory; /** @@ -167,8 +168,8 @@ public void runAnalysis(String fileName) { // Print analysis report. As a JSON string in this case. writeToConsole(""); - writeToConsole(ReportsFactory.getInstance(SupportedVerbosityLevel.DETAILED).getReportAsPlainText(project, resultSet)); - } catch (MalformedURLException ex) { + writeToConsole(ReportsFactory.getInstance(SupportedVerbosityLevel.DETAILED).getReportAsBeautifiedJSONString(project, resultSet)); + } catch (MalformedURLException | JSONException | IllegalArgumentException ex) { writeToConsole(ownI18N.getString(NOT_A_VALID_JSON_1) + " " + fileName + ". " + ownI18N.getString(NOT_A_VALID_JSON_2)); } }