Skip to content

Commit

Permalink
Add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Aug 27, 2024
1 parent 51f79f3 commit 94cd5f6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,16 @@ private boolean completeUploadExternal(String channelId, String threadTs, List<S
}

jsonObject.put("files", convertListToJsonArray(fileIds));

logger.info("Completing upload with: " + jsonObject);
HttpUriRequest completeRequest = RequestBuilder
.post("https://slack.com/api/files.completeUploadExternal")
.setEntity(new StringEntity(jsonObject.toString(), ContentType.APPLICATION_JSON))
.addHeader("Authorization", "Bearer " + token)
.build();

JSONObject completeRequestResponse = client.execute(completeRequest, getStandardResponseHandler());
logger.info("Upload complete response: " + completeRequestResponse);

Check warning on line 141 in src/main/java/jenkins/plugins/slack/pipeline/SlackUploadFileRunner.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 133-141 are not covered by tests

if (completeRequestResponse != null && !completeRequestResponse.getBoolean("ok")) {
listener.getLogger().println(UPLOAD_FAILED_TEMPLATE + completeRequestResponse);
Expand Down

0 comments on commit 94cd5f6

Please sign in to comment.