What does the following mean in
Java: "wrapping an exception"?
Consider the following code: (Only the part in bold)
public static void setObjectColor( Object obj, Color color ) {
Class cls = obj.getClass();
try {
Method method = cls.getMethod( "setColor",
new Class[] {Color.class} );
method.invoke( obj, new Object[] {color} );
}
catch (NoSuchMethodException ex) {
throw new IllegalArgumentException(
cls.getName()
+ " does not support method setColor(Color)" );
}
catch (IllegalAccessException ex) {
throw new IllegalArgumentException(
"Insufficient access permissions to call"
+ "setColor(:Color) in class " + cls.getName());
}
catch (InvocationTargetException ex) {
throw new RuntimeException(ex);
}
}
The above code snippet is from : Java Reflection in Action
After this code snippet, there is a statement:
For simplicity�s sake, the code in listing 1.1 handles these exceptions by wrapping them in runtime exceptions.
I can't figure out the meaning of the above statement in the context of the aforementioned code. Please explain.