Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
710584c
Throw JiraException from getVersions method call
Jun 17, 2025
bee6252
Apply spotless changes
Jun 17, 2025
4a0e1ee
Remove unused method
Jun 17, 2025
6026714
Replace JiraException class with RestClientException class
Jun 18, 2025
68db05e
Merge branch 'master' into issue_702_log_appropriate_messages
Hardikrathod01 Jun 18, 2025
7486646
Handle errors of addComment and getIssue methods in their root callin…
Jun 18, 2025
78748a0
Handle errors of getProjectKeys method
Jun 18, 2025
a4694cd
Handle errors of all the other remaining methods
Jun 18, 2025
dfc948d
Remove unnecessary multi catch
Jun 18, 2025
3c2df7a
Throw JiraException from getVersions method call
Jun 17, 2025
7f3467b
Apply spotless changes
Jun 17, 2025
b8e9a18
Remove unused method
Jun 17, 2025
dac8e3b
Replace JiraException class with RestClientException class
Jun 18, 2025
30aa790
Handle errors of addComment and getIssue methods in their root callin…
Jun 18, 2025
b9e3552
Handle errors of getProjectKeys method
Jun 18, 2025
df579b9
Handle errors of all the other remaining methods
Jun 18, 2025
5919929
Remove unnecessary multi catch
Jun 18, 2025
1da0825
Merge remote-tracking branch 'origin/issue_702_log_appropriate_messag…
Jun 18, 2025
b74098f
Merge branch 'master' into issue_702_log_appropriate_messages
Hardikrathod01 Jun 24, 2025
710510c
Fix spotless issue
Jun 24, 2025
4b9e81a
Update for adding test cases
Jun 24, 2025
452459f
- Update for Replacing "Jira Error" with Jira
Aug 12, 2025
d10ad54
- Fix never thrown exception catch error
Aug 12, 2025
97a1bda
- Fix test cases
Aug 12, 2025
c6b211e
- Replace TimeoutException tests with RestclientException tests
Aug 12, 2025
27466fa
- Remove not thrown exception from doc
Aug 12, 2025
9b3586f
- Fix spotless issues
Aug 12, 2025
ac8b0cb
- Handle IOException and RestClientException in a single catch
Aug 12, 2025
4da8620
resolve conflicts
rantoniuk Nov 25, 2025
39df064
Merge branch 'master' into Hardikrathod01-issue_702_log_appropriate_m…
rantoniuk Nov 25, 2025
593b0cd
Apply CoPilot suggestions from code review
rantoniuk Nov 25, 2025
57fd58d
chore: spotless:apply
rantoniuk Nov 25, 2025
6e8b151
fix dereference error
rantoniuk Nov 25, 2025
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
17 changes: 11 additions & 6 deletions src/main/java/hudson/plugins/jira/JiraCreateIssueNotifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static hudson.plugins.jira.JiraRestService.BUG_ISSUE_TYPE_ID;

import com.atlassian.jira.rest.client.api.RestClientException;
import com.atlassian.jira.rest.client.api.StatusCategory;
import com.atlassian.jira.rest.client.api.domain.Issue;
import com.atlassian.jira.rest.client.api.domain.IssueType;
Expand Down Expand Up @@ -164,12 +165,16 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
}

if (currentBuildResult != Result.ABORTED && previousBuild != null) {
if (currentBuildResult == Result.FAILURE) {
currentBuildResultFailure(build, listener, previousBuildResult, filename, vars);
}
try {
if (currentBuildResult == Result.FAILURE) {
currentBuildResultFailure(build, listener, previousBuildResult, filename, vars);
}

if (currentBuildResult == Result.SUCCESS) {
currentBuildResultSuccess(build, listener, previousBuildResult, filename, vars);
if (currentBuildResult == Result.SUCCESS) {
currentBuildResultSuccess(build, listener, previousBuildResult, filename, vars);
}
} catch (RestClientException e) {
listener.getLogger().println(e.getMessage());
}
}
return true;
Expand Down Expand Up @@ -342,7 +347,7 @@ private void currentBuildResultFailure(
Result previousBuildResult,
String filename,
EnvVars vars)
throws InterruptedException, IOException {
throws InterruptedException, IOException, RestClientException {

if (previousBuildResult == Result.FAILURE) {
String comment = String.format("Build is still failing.%nFailed run: %s", getBuildDetailsString(vars));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package hudson.plugins.jira;

import com.atlassian.jira.rest.client.api.RestClientException;
import hudson.Extension;
import hudson.Launcher;
import hudson.model.AbstractBuild;
Expand Down Expand Up @@ -50,7 +51,13 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
return false;
}

Set<String> ids = getIssueSelector().findIssueIds(build, site, listener);
Set<String> ids;
try {
ids = getIssueSelector().findIssueIds(build, site, listener);
} catch (RestClientException e) {
listener.getLogger().println(e.getMessage());
return false;
}

String idList = StringUtils.join(ids, ",");
Integer idListSize = ids.size();
Expand Down
13 changes: 4 additions & 9 deletions src/main/java/hudson/plugins/jira/JiraIssueUpdateBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,15 @@
*/
package hudson.plugins.jira;

import com.atlassian.jira.rest.client.api.RestClientException;
import hudson.EnvVars;
import hudson.Extension;
import hudson.Util;
import hudson.model.AbstractProject;
import hudson.model.Job;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.model.*;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;
import hudson.util.FormValidation;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
import jenkins.tasks.SimpleBuildStep;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.Symbol;
Expand Down Expand Up @@ -105,9 +101,8 @@ public void perform(Run<?, ?> run, EnvVars env, TaskListener listener) throws In
listener.getLogger().println(Messages.JiraIssueUpdateBuilder_SomeIssuesFailed());
run.setResult(Result.UNSTABLE);
}
} catch (TimeoutException e) {
listener.getLogger().println(Messages.JiraIssueUpdateBuilder_Failed());
e.printStackTrace(listener.getLogger());
} catch (RestClientException e) {
listener.getLogger().println(e.getMessage());
run.setResult(Result.FAILURE);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/hudson/plugins/jira/JiraJobAction.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package hudson.plugins.jira;

import com.atlassian.jira.rest.client.api.RestClientException;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.Extension;
Expand Down Expand Up @@ -127,8 +128,9 @@ public void onStarted(WorkflowRun workflowRun, TaskListener listener) {
if (site != null) {
try {
setAction(parent, site);
} catch (IOException e) {
} catch (IOException | RestClientException e) {
LOGGER.log(Level.WARNING, "Could not set JiraJobAction for <" + parent.getFullName() + ">", e);
listener.getLogger().println(e.getMessage());
}
}
}
Expand Down
Loading
Loading