Skip to content

Commit

Permalink
Added a error display----trial----- #2
Browse files Browse the repository at this point in the history
  • Loading branch information
herme committed Jan 22, 2024
1 parent 93789f7 commit 5131b26
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,19 @@ public void run(TaskMonitor taskMonitor) {
}

HttpEntity responseEntity = response.getEntity();
// if (responseEntity.getContent().instanceof(String))

JSONArray jsonResponse1= (JSONArray) new JSONParser().parse(new InputStreamReader(responseEntity.getContent()));

try {
JSONArray jsonResponse1= (JSONArray) new JSONParser().parse(new InputStreamReader(responseEntity.getContent()));


} catch (Exception e) { taskMonitor.showMessage(TaskMonitor.Level.ERROR,
"Error from server: " + responseEntity.toString());
e.printStackTrace(System.out);
}


JSONArray jsonResponse1= (JSONArray) new JSONParser().parse(new InputStreamReader(responseEntity.getContent()));

// JSONObject jsonResponse = (JSONObject) new JSONParser().parse(new InputStreamReader(responseEntity.getContent()));
// JSONObject jsonResponse=(JSONObject) responseEntity ;
Expand Down

0 comments on commit 5131b26

Please sign in to comment.