apache / apache/maven-help-plugin

[MPH-218] Embed original exceptions as cause in DescribeMojo

Open
#335 0 comments 0 reactions 0 assignees View on GitHub
maintenance priority:minor
Dominant language
Java
Stars
29
Forks
42
Avg merge
1d 12h
Merged PRs (30d)
6

Description

**[Elliotte Rusty Harold](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=elharo)** opened **[MPH-218](https://issues.apache.org/jira/browse/MPH-218?redirect=false)** and commented

{{ return output;
} catch (SecurityException e) {
throw new MojoFailureException("SecurityException: " + e.getMessage());
} catch (IllegalArgumentException e) {
throw new MojoFailureException("IllegalArgumentException: " + e.getMessage());
} catch (NoSuchMethodException e) {
throw new MojoFailureException("NoSuchMethodException: " + e.getMessage());
} catch (IllegalAccessException e) {
throw new MojoFailureException("IllegalAccessException: " + e.getMessage());
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();

if (cause instanceof NegativeArraySizeException) {
throw new MojoFailureException("NegativeArraySizeException: " + cause.getMessage());
}

throw new MojoFailureException("InvocationTargetException: " + e.getMessage());
}}}

---
No further details from [MPH-218](https://issues.apache.org/jira/browse/MPH-218?redirect=false)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the exception-handling code in DescribeMojo shown in the issue and inspect how each caught exception is wrapped. Confirm that the resulting MojoFailureException retains the original exception as its cause, including InvocationTargetException paths; use the relevant project tests or add coverage if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.