Skip to content

Commit

Permalink
Stop using deprecated exception type (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Nov 30, 2024
1 parent 21be285 commit 6c96281
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package hudson.plugins.promoted_builds;

import antlr.ANTLRException;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.BulkChange;
import hudson.EnvVars;
Expand Down Expand Up @@ -249,7 +248,7 @@ public String getAssignedLabelString() {
try {
LabelExpression.parseExpression(assignedLabel);
return assignedLabel;
} catch (ANTLRException e) {
} catch (IllegalArgumentException e) {
// must be old label or host name that includes whitespace or other unsafe chars
return LabelAtom.escape(assignedLabel);
}
Expand Down Expand Up @@ -651,7 +650,7 @@ public FormValidation doCheckLabelString(@QueryParameter String value) {
return FormValidation.ok(); // nothing typed yet
try {
Label.parseExpression(value);
} catch (ANTLRException e) {
} catch (IllegalArgumentException e) {

Check warning on line 653 in src/main/java/hudson/plugins/promoted_builds/PromotionProcess.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 251-653 are not covered by tests
return FormValidation.error(e,
Messages.JobPropertyImpl_LabelString_InvalidBooleanExpression(e.getMessage()));
}
Expand Down

0 comments on commit 6c96281

Please sign in to comment.