class CollectionView extends FrameLayout {

  void showError(Throwable throwable) {
    if (adapter == null) {
      throw new NullPointerException("adapter is null");
    }
    refreshLayout.setRefreshing(false);
    final View errorView;
    final Class<? extends Throwable> errorClass = throwable.getClass();
    if (errorViewHolder.containsKey(errorClass)) {
      errorView = errorViewHolder.get(errorClass);
    } else {
      errorView = adapter.onCreateErrorView(this, throwable);
      errorView.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
          if (presenter != null) {
            presenter.onLoad();
          }
        }
      });
      errorViewHolder.put(errorClass, errorView);
    }
    addView(errorView, lpWrapWrapCenter());
  }

  public  CollectionView(
      @NonNull Context context,
      @Nullable AttributeSet attrs);

}