def __open_dbms_conn(self): """opens a connection to postgresql""" try: return HelperPg.connect(self.pgsql_conf) except psycopg2.Error as e: self.logger.error(e) raise DocBuilderError("dbms was not connected") except KeyError as e: self.logger.error(e) raise DocBuilderError("slack pgsql configuration")
def open_dbms_conn(logger, pgsql_conf): """opens a connection to postgresql""" try: return HelperPg.connect(pgsql_conf) except psycopg2.Error as e: logger.error(e) raise Exception("dbms was not connected") except KeyError as e: logger.error(e) raise Exception("slack pgsql configuration")