public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: RuntimeException rex = new RuntimeException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: throw new RuntimeException("[was "+t.getClass()+"] "+t.getMessage(), t); }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: throw new RuntimeException("[was "+t.getClass()+"] "+t.getMessage(), t); }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: throw new RuntimeException("[was "+t.getClass()+"] "+t.getMessage(), t); }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: RuntimeException rex = new RuntimeException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And if possible, indicate the root cause (1.4+ only) JdkFeatures.getInstance().setInitCause(rex, t); throw rex; }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And if possible, indicate the root cause (1.4+ only) JdkFeatures.getInstance().setInitCause(rex, t); throw rex; }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And if possible, indicate the root cause (1.4+ only) JdkFeatures.getInstance().setInitCause(rex, t); throw rex; }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: RuntimeException rex = new RuntimeException("[was "+t.getClass()+"] "+t.getMessage()); // And if possible, indicate the root cause (1.4+ only) JdkFeatures.getInstance().setInitCause(rex, t); throw rex; }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: RuntimeException rex = new RuntimeException("[was "+t.getClass()+"] "+t.getMessage()); // And if possible, indicate the root cause (1.4+ only) JdkFeatures.getInstance().setInitCause(rex, t); throw rex; }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: RuntimeException rex = new RuntimeException("[was "+t.getClass()+"] "+t.getMessage()); // And if possible, indicate the root cause (1.4+ only) JdkFeatures.getInstance().setInitCause(rex, t); throw rex; }