Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,18 @@
return;
}
}
// Log response body to help debug errors from REST APIs (only if not already logged)
if (!consoleLogResponseBody) {
try {
String content = response.getContent();
if (content != null && !content.isEmpty()) {

Check warning on line 509 in src/main/java/jenkins/plugins/http_request/HttpRequestExecution.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 509 is only partially covered, 2 branches are missing
logger().println("Response: \n" + content);
}
} catch (Exception e) {
// Ignore errors when trying to read response content
logger().println("Unable to read response body: " + e.getMessage());

Check warning on line 514 in src/main/java/jenkins/plugins/http_request/HttpRequestExecution.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 512-514 are not covered by tests
}
}
throw new AbortException("Fail: Status code " + response.getStatus() + " is not in the accepted range: " + validResponseCodes + " while calling " + url);
}

Expand Down
Loading