Created
February 20, 2015 22:13
-
-
Save jabKnowsNothing/1f64f77c162ee5042670 to your computer and use it in GitHub Desktop.
Blog: google default failure handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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