8296226: Add constructors (String,Throwable) and (Throwable) to InvalidParameterException

Reviewed-by: mullan, mdoerr
This commit is contained in:
Matthias Baesken 2022-11-07 07:50:12 +00:00
parent 51f8e9b0e1
commit 8836b92593
8 changed files with 60 additions and 13 deletions

View file

@ -58,4 +58,44 @@ public class InvalidParameterException extends IllegalArgumentException {
public InvalidParameterException(String msg) {
super(msg);
}
/**
* Constructs an {@code InvalidParameterException} with the specified
* detail message and cause. A detail message is a {@code String}
* that describes this particular exception.
*
* <p>Note that the detail message associated with {@code cause} is
* <i>not</i> automatically incorporated in this exception's detail
* message.
*
* @param msg the detail message (which is saved for later retrieval
* by the {@link Throwable#getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
* {@link Throwable#getCause()} method). (A {@code null} value
* is permitted, and indicates that the cause is nonexistent or
* unknown.)
*
* @since 20
*/
public InvalidParameterException(String msg, Throwable cause) {
super(msg, cause);
}
/**
* Constructs an {@code InvalidParameterException} with the specified cause
* and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of {@code cause}).
* This constructor is useful for exceptions that are little more than
* wrappers for other throwables.
*
* @param cause the cause (which is saved for later retrieval by the
* {@link Throwable#getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or
* unknown.)
*
* @since 20
*/
public InvalidParameterException(Throwable cause) {
super(cause);
}
}