diff --git a/src/utils.py b/src/utils.py index 276e7b0a..227c6525 100644 --- a/src/utils.py +++ b/src/utils.py @@ -14,7 +14,7 @@ from six import iteritems -from .exceptions import ExecUtilException +from .exceptions import ExecUtilException, InvalidOperationException from .config import testgres_config as tconf from .raise_error import RaiseError from .enums import NodeStatus @@ -263,7 +263,12 @@ def cache_pg_config_data(cmd): return cache_pg_config_data(cmd) # try plain name - return cache_pg_config_data("pg_config") + try: + pg_config_data = cache_pg_config_data("pg_config") + except Exception: + raise InvalidOperationException( + "Failed to determine how to start pg_config. Either specify the path to pg_config in PG_CONFIG or specify the path to the Postgres directory containing pg_config in PG_BIN, or put pg_config into the system PATH.") + return pg_config_data def get_pg_version2(os_ops: OsOperations, bin_dir=None):