Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ def disable_logging_to_file() -> None:
if not os.path.exists(EXAMPLES_PATH):
os.makedirs(EXAMPLES_PATH)

except:
except Exception:
pass
7 changes: 5 additions & 2 deletions src/ansys/fluent/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

try:
from ansys.fluent.core.solver.settings import root
except:
except Exception:
root = Any
from ansys.fluent.core.utils.logging import LOG

Expand Down Expand Up @@ -290,7 +290,10 @@ def stop_transcript(self) -> None:
def check_health(self) -> str:
"""Check health of Fluent connection."""
if self._channel:
return self._health_check_service.check_health()
try:
return self._health_check_service.check_health()
except Exception:
return HealthCheckService.Status.NOT_SERVING.name
else:
return HealthCheckService.Status.NOT_SERVING.name

Expand Down
3 changes: 1 addition & 2 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ def test_create_session_from_server_info_file_with_wrong_password(
session = Session.create_from_server_info_file(
server_info_filepath=server_info_file, cleanup_on_exit=False
)
with pytest.raises(RuntimeError):
session.check_health()
assert session.check_health() == HealthCheckService.Status.NOT_SERVING.name
server.stop(None)
session.exit()
assert session.check_health() == HealthCheckService.Status.NOT_SERVING.name
Expand Down