public Integer mapThrowable(final Throwable throwable){
  Throwable throwableToCheck=throwable;
  int depthToGo=20;
  while (true) {
    Integer resId=mapThrowableFlat(throwableToCheck);
    if (resId != null) {
      return resId;
    }
 else {
      throwableToCheck=throwableToCheck.getCause();
      depthToGo--;
      if (depthToGo <= 0 || throwableToCheck == throwable || throwableToCheck == null) {
        Log.d(EventBus.TAG,"No specific message ressource ID found for " + throwable);
        return null;
      }
    }
  }
}

public Integer mapThrowable ( final Throwable throwable ) { Throwable throwableToCheck = throwable ; int depthToGo = 20 ; while ( true ) { Integer resId = mapThrowableFlat ( throwableToCheck ) ; if ( resId != null ) { return resId ; } else { throwableToCheck = throwableToCheck . getCause ( ) ; depthToGo -- ; if ( depthToGo <= 0 || throwableToCheck == throwable || throwableToCheck == null ) { Log . d ( EventBus . TAG , "No specific message ressource ID found for " + throwable ) ; return null ; } } } }
looks at the exception and its causes trying to find an id .
