Skip to content

Commit 59a2c5f

Browse files
prmukherjpyansys-ci-botCopilot
authored
chore: Update text for 'BetaFeaturesNotEnabled' exception. (#4581)
## Context The exception message was not clear. The message was slightly inaccurate, as it suggested that beta features can only be enabled via a Python call. ## Change Summary The exception message was updated to be more precise about the need of the python call. ## Impact Users will see the updated error message when 'BetaFeaturesNotEnabled' is raised. --------- Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent ebbf84d commit 59a2c5f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update text for 'BetaFeaturesNotEnabled' exception.

src/ansys/fluent/core/exceptions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ class BetaFeaturesNotEnabled(RuntimeError):
5656
"""Raised when a beta feature is accessed without enabling beta features."""
5757

5858
def __init__(self, feature_name: str | None = None) -> None:
59+
base_message = (
60+
" is a Fluent beta feature. To enable it from Python "
61+
"call '<session>.enable_beta_features()'."
62+
)
5963
message = (
60-
f"The feature '{feature_name}' is not available until 'enable_beta_features()' has been called."
64+
f"'{feature_name}'" + base_message
6165
if feature_name
62-
else "This feature is not available until 'enable_beta_features()' has been called."
66+
else "This " + base_message
6367
)
6468
super().__init__(message)

0 commit comments

Comments
 (0)