Skip to content

Instantly share code, notes, and snippets.

@jabKnowsNothing
Created February 20, 2015 22:13
Show Gist options
  • Save jabKnowsNothing/1f64f77c162ee5042670 to your computer and use it in GitHub Desktop.
Save jabKnowsNothing/1f64f77c162ee5042670 to your computer and use it in GitHub Desktop.
Blog: google default failure handler
private static class CustomFailureHandler implements FailureHandler {
private final FailureHandler delegate;
public CustomFailureHandler(Context targetContext) {
delegate = new DefaultFailureHandler(targetContext);
}
@Override
public void handle(Throwable error, Matcher<View> viewMatcher) {
try {
delegate.handle(error, viewMatcher);
} catch (NoMatchingViewException e) {
throw new MySpecialException(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment