Skip to content

Commit

Permalink
Merge pull request #192 from basil/jakarta-nested-exception
Browse files Browse the repository at this point in the history
Allow for deeply nested causes
  • Loading branch information
jglick authored May 23, 2024
2 parents 15c9e3f + 46a28cc commit 4bcc83e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package io.jenkins.plugins.file_parameters;

import com.google.common.base.Throwables;
import hudson.cli.CLICommand;
import hudson.model.Failure;
import hudson.model.ParameterDefinition;
Expand Down Expand Up @@ -69,8 +70,7 @@ protected Object readResolve() {
src = req.getFileItem(getName());
} catch (Exception x) {
// TODO simplify when we drop support for Commons FileUpload 1.x

Check warning on line 72 in src/main/java/io/jenkins/plugins/file_parameters/AbstractFileParameterDefinition.java

View check run for this annotation

ci.jenkins.io / Open Tasks Scanner

TODO

NORMAL: simplify when we drop support for Commons FileUpload 1.x
String simpleName =
x.getCause() != null ? x.getCause().getClass().getSimpleName() : null;
String simpleName = Throwables.getRootCause(x).getClass().getSimpleName();
if ("InvalidContentTypeException".equals(simpleName) /* Commons FileUpload 1.x */
|| "FileUploadContentTypeException".equals(simpleName)) /* Commons FileUpload 2.x */ {
src = null;
Expand Down

0 comments on commit 4bcc83e

Please sign in to comment.