You could write a Custom Matcher:
public final class CustomItemMatchers {
private static class TextInputLayoutErrorMatcher extends BoundedMatcher
You can use it then with
matches(CustomItemMatchers.withErrorName(equalTo("My Error")))
This code was written with Espresso 1, but I hope it still works.