Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 0b34d07

Browse files
dipinknairklmcadamsPipKat
authored
FIX: Update error handling for path (#261)
Co-authored-by: Kerry McAdams <[email protected]> Co-authored-by: Kathy Pippert <[email protected]>
1 parent fc2741f commit 0b34d07

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ansys/tools/path/path.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ def _get_application_path(
999999
exe_loc = _prompt_path(product)
10001000
_change_default_path(product, exe_loc)
10011001
return exe_loc
1002-
1002+
warnings.warn(f"No path found for {product} in default locations.")
10031003
return None
10041004

10051005

@@ -1156,7 +1156,11 @@ def version_from_path(product: PRODUCT_TYPE, path: str) -> int:
11561156
11571157
"""
11581158
if not isinstance(path, str):
1159-
raise ValueError(f"Provided path '{path}' is not a string.")
1159+
raise ValueError(
1160+
f'The provided path, "{path}", is not a valid string. '
1161+
f'If "{product}" is not installed in the default location, use ``save-ansys-path`` '
1162+
f"to save the path so it can be found by ``ansys-tools-path``."
1163+
)
11601164
if product == "mechanical":
11611165
return _mechanical_version_from_path(path)
11621166
elif product == "mapdl":

0 commit comments

Comments
 (0)