final public function createPager(
        string $querySelect,
        string $queryCount = '',
        int $page = 1,
        int $recordsPerPage = 20
    ): Pager {
        $previous = null;
        try {
            $pager = new Pager($this, $querySelect, $queryCount);
            $pager->setPageSize($recordsPerPage);
            $success = ($page == -1) ? $pager->queryAll() : $pager->queryPage($page);
            if (! $success) {
                $pager = false;
            }
        } catch (\Throwable $exception) {
            $previous = $exception;
            $pager = false;
        }
        if (! ($pager instanceof Pager)) {
            throw new QueryException('Unable to create a valid Pager', $querySelect, 0, $previous);
        }

        return $pager;
    }
final public function createPager(
        string $querySelect,
        string $queryCount = '',
        int $page = 1,
        int $recordsPerPage = 20
    ): Pager {
        $previous = null;
        try {
            $pager = new Pager($this, $querySelect, $queryCount);
            $pager->setPageSize($recordsPerPage);
            $success = ($page == -1) ? $pager->queryAll() : $pager->queryPage($page);
            if (! $success) {
                $pager = false;
            }
        } catch (\Throwable $exception) {
            $previous = $exception;
            $pager = false;
        }
        if (! ($pager instanceof Pager)) {
            throw new QueryException('Unable to create a valid Pager', $querySelect, 0, $previous);
        }

        return $pager;
    }
final public function createPager ( string $ querySelect , string $ queryCount = '' , int $ page = 1 , int $ recordsPerPage = 20 ) : Pager { $ previous = null ; try { $ pager = new Pager ( $ this , $ querySelect , $ queryCount ) ; $ pager -> setPageSize ( $ recordsPerPage ) ; $ success = ( $ page == - 1 ) ? $ pager -> queryAll ( ) : $ pager -> queryPage ( $ page ) ; if ( ! $ success ) { $ pager = false ; } } catch ( \ Throwable $ exception ) { $ previous = $ exception ; $ pager = false ; } if ( ! ( $ pager instanceof Pager ) ) { throw new QueryException ( 'Unable to create a valid Pager' , $ querySelect , 0 , $ previous ) ; } return $ pager ; }
This is an strict mode of queryPager but throws an exception instead of return FALSE

@param string $querySelect
@param string $queryCount
@param int $page
@param int $recordsPerPage
@see DBAL::queryPager()
@throws QueryException if some error occurs when creating the Pager object or getting the page
@return Pager
This is an strict mode of queryPager but throws an exception instead of return FALSE