@Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String chromePackage = CustomTabsClient.getPackageName(this,
                TrustedWebUtils.SUPPORTED_CHROME_PACKAGES, false);
        if (chromePackage == null) {
            onError(new RuntimeException("No valid build of Chrome found"));
            finish();
            return;
        }

        View loadingView = createLoadingView();
        if (loadingView != null) {
            setContentView(loadingView);
        }

        CustomTabsClient.bindCustomTabsService(this, chromePackage, mServiceConnection);
    }
Override to implement custom error handling.
customtabs/src/android/support/customtabs/trusted/ManageDataLauncherActivity.java