Fix video rippers: Revert breaking change to exception handling.
This commit is contained in:
parent
0164656d39
commit
33520a205e
@ -20,7 +20,6 @@ import com.rarchives.ripme.ui.RipStatusHandler;
|
|||||||
import com.rarchives.ripme.ui.RipStatusMessage;
|
import com.rarchives.ripme.ui.RipStatusMessage;
|
||||||
import com.rarchives.ripme.ui.RipStatusMessage.STATUS;
|
import com.rarchives.ripme.ui.RipStatusMessage.STATUS;
|
||||||
import com.rarchives.ripme.utils.Utils;
|
import com.rarchives.ripme.utils.Utils;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
|
|
||||||
public abstract class AbstractRipper
|
public abstract class AbstractRipper
|
||||||
extends Observable
|
extends Observable
|
||||||
@ -294,31 +293,19 @@ public abstract class AbstractRipper
|
|||||||
public static AbstractRipper getRipper(URL url) throws Exception {
|
public static AbstractRipper getRipper(URL url) throws Exception {
|
||||||
for (Constructor<?> constructor : getRipperConstructors("com.rarchives.ripme.ripper.rippers")) {
|
for (Constructor<?> constructor : getRipperConstructors("com.rarchives.ripme.ripper.rippers")) {
|
||||||
try {
|
try {
|
||||||
AlbumRipper ripper = (AlbumRipper) constructor.newInstance(url);
|
AlbumRipper ripper = (AlbumRipper) constructor.newInstance(url); // by design: can throw ClassCastException
|
||||||
logger.debug("Found album ripper: " + ripper.getClass().getName());
|
logger.debug("Found album ripper: " + ripper.getClass().getName());
|
||||||
return ripper;
|
return ripper;
|
||||||
} catch (InstantiationException e) {
|
} catch (Exception e) {
|
||||||
// Incompatible rippers *will* throw exceptions during instantiation.
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
// Incompatible rippers *will* throw exceptions during instantiation.
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
// Incompatible rippers *will* throw exceptions during instantiation.
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
// Incompatible rippers *will* throw exceptions during instantiation.
|
// Incompatible rippers *will* throw exceptions during instantiation.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Constructor<?> constructor : getRipperConstructors("com.rarchives.ripme.ripper.rippers.video")) {
|
for (Constructor<?> constructor : getRipperConstructors("com.rarchives.ripme.ripper.rippers.video")) {
|
||||||
try {
|
try {
|
||||||
VideoRipper ripper = (VideoRipper) constructor.newInstance(url);
|
VideoRipper ripper = (VideoRipper) constructor.newInstance(url); // by design: can throw ClassCastException
|
||||||
logger.debug("Found video ripper: " + ripper.getClass().getName());
|
logger.debug("Found video ripper: " + ripper.getClass().getName());
|
||||||
return ripper;
|
return ripper;
|
||||||
} catch (InstantiationException e) {
|
} catch (Exception e) {
|
||||||
// Incompatible rippers *will* throw exceptions during instantiation.
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
// Incompatible rippers *will* throw exceptions during instantiation.
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
// Incompatible rippers *will* throw exceptions during instantiation.
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
// Incompatible rippers *will* throw exceptions during instantiation.
|
// Incompatible rippers *will* throw exceptions during instantiation.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user