From 1dbff05bf375557ea73e07632d732bd90a71af9e Mon Sep 17 00:00:00 2001 From: Kevin Jin Date: Fri, 6 Mar 2015 11:30:46 -0800 Subject: runOnMainSync on a single thread Add DroidDriverException.propagate Change-Id: I7bdcbe1642b4448cc40a06995950573ebd890b4f --- src/io/appium/droiddriver/helpers/DroidDrivers.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/io/appium/droiddriver/helpers') diff --git a/src/io/appium/droiddriver/helpers/DroidDrivers.java b/src/io/appium/droiddriver/helpers/DroidDrivers.java index 5cddb4f..7725bf5 100644 --- a/src/io/appium/droiddriver/helpers/DroidDrivers.java +++ b/src/io/appium/droiddriver/helpers/DroidDrivers.java @@ -20,8 +20,6 @@ import android.annotation.TargetApi; import android.app.Instrumentation; import android.os.Build; -import java.lang.reflect.InvocationTargetException; - import io.appium.droiddriver.DroidDriver; import io.appium.droiddriver.exceptions.DroidDriverException; import io.appium.droiddriver.instrumentation.InstrumentationDriver; @@ -77,18 +75,8 @@ public class DroidDrivers { try { return (DroidDriver) Class.forName(driverClass).getConstructor(Instrumentation.class) .newInstance(instrumentation); - } catch (ClassNotFoundException e) { - throw new DroidDriverException(e); - } catch (NoSuchMethodException e) { - throw new DroidDriverException(e); - } catch (InstantiationException e) { - throw new DroidDriverException(e); - } catch (IllegalAccessException e) { - throw new DroidDriverException(e); - } catch (IllegalArgumentException e) { - throw new DroidDriverException(e); - } catch (InvocationTargetException e) { - throw new DroidDriverException(e); + } catch (Throwable t) { + throw DroidDriverException.propagate(t); } } -- cgit v1.2.3