wrapped access to pgb connection api in try/catch