public class DroidDriverException
extends java.lang.RuntimeException
All exceptions should extend this.
Constructor and Description |
---|
DroidDriverException(java.lang.String message) |
DroidDriverException(java.lang.String message,
java.lang.Throwable cause) |
DroidDriverException(java.lang.Throwable cause) |
Modifier and Type | Method and Description |
---|---|
static DroidDriverException |
propagate(java.lang.Throwable throwable)
Adapted from Guava libraries.
|
public DroidDriverException(java.lang.String message)
public DroidDriverException(java.lang.Throwable cause)
public DroidDriverException(java.lang.String message, java.lang.Throwable cause)
public static DroidDriverException propagate(java.lang.Throwable throwable)
Propagates throwable
as-is if it is an instance of RuntimeException
or Error
, or else as a last resort, wraps it in a DroidDriverException
and then
propagates.
This method always throws an exception. The DroidDriverException
return
type is only for client code to make Java type system happy in case a return value is required
by the enclosing method. Example usage:
T doSomething() { try { return someMethodThatCouldThrowAnything(); } catch (IKnowWhatToDoWithThisException e) { return handle(e); } catch (Throwable t) { throw DroidDriverException.propagate(t); } }
throwable
- the Throwable to propagate