Skip to content

Commit

Permalink
Add specific details to non-200 response code errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan McCauley authored and Ryan McCauley committed Aug 1, 2016
1 parent 5c3835e commit 24bd7fd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,19 @@ public void updateProjects(boolean ignoreMessages) {
while ((line = rd.readLine()) != null) {
result.append(line);
}
if(response.getStatusLine().getStatusCode() == 200){
int code = response.getStatusLine().getStatusCode();
if(code == 200){
projectArr = parseProjectJson(result.toString(), ignoreMessages);
} else if(!ignoreMessages){
error("An error occurred while trying to update the project list."
+ "\nThe server returned response code: " + response.getStatusLine() + '.');
String msg = "An error occurred while trying to update the project list."
+ "\nThe server returned response code: " + response.getStatusLine() + '.';
if(code == 403)
msg += "\nVerify that the API key is correct and active.";
else if(code == 404)
msg += "\nVerify that the Server URL is correct.";
else if(code == 400)
msg += "\nVerify that the Server URL is correct and that you are connecting\nwith the correct port.";
error(msg);
}
}
} catch (JSONException | IOException e){
Expand Down

0 comments on commit 24bd7fd

Please sign in to comment.