Skip to content

Commit

Permalink
ASA-8145
Browse files Browse the repository at this point in the history
Meaningful message to be conveyed when Jenkins loses connection to ASoC while scan is in progress.
  • Loading branch information
vishalhcl-5960 committed Feb 22, 2024
1 parent ac726b8 commit 443415d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public NonCompliantIssuesResultProvider(String scanId, String type, IScanService
protected void loadResults() {
try {
JSONObject items = m_scanProvider.getScanDetails(m_scanId);
JSONObject obj = items.getJSONObject(LATEST_EXECUTION);
JSONObject obj = items == null ? null : items.getJSONObject(LATEST_EXECUTION);
if (obj == null) {
m_status = FAILED;
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ public JSONObject getScanDetails(String scanId) throws IOException, JSONExceptio
if (response.getResponseCode() == HttpsURLConnection.HTTP_OK || response.getResponseCode() == HttpsURLConnection.HTTP_CREATED){
JSONObject obj = (JSONObject) response.getResponseBodyAsJSON();
JSONArray array = (JSONArray) obj.get(ITEMS);
return (JSONObject) array.getJSONObject(0);
if(array.isEmpty()) {
m_progress.setStatus(new Message(Message.ERROR, Messages.getMessage(ERROR_GETTING_DETAILS, scanId)));
} else {
return (JSONObject) array.getJSONObject(0);
}
} else if (response.getResponseCode() == -1) {
return new JSONObject().put(STATUS,UNKNOWN); //If the server is not reachable Internet disconnect
} else if (response.getResponseCode() != HttpsURLConnection.HTTP_BAD_REQUEST) {
Expand Down

0 comments on commit 443415d

Please sign in to comment.