Skip to content

Commit 8b282ae

Browse files
committed
fix(exceptions): collect all under common module
1 parent 3bbf43c commit 8b282ae

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ansys/tools/common/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ def __init__(self, message: str) -> None:
3434
self.message = message
3535

3636

37+
class ProductInstanceError(AnsysError):
38+
"""Custom exception for ProductInstance lifecycle errors."""
39+
40+
3741
class AnsysHostnameValueError(AnsysError):
3842
"""Error raised when hostname value is not valid."""
3943

src/ansys/tools/common/launcher/product_instance.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,15 @@
3232
import grpc
3333
from typing_extensions import Self
3434

35+
from ansys.tools.common.exceptions import ProductInstanceError
36+
3537
from .interface import LAUNCHER_CONFIG_T, LauncherProtocol, ServerType
3638

3739
__all__ = ["ProductInstance", "ProductInstanceError"]
3840

3941
_GRPC_MAX_MESSAGE_LENGTH = 256 * 1024**2 # 256 MB
4042

4143

42-
class ProductInstanceError(RuntimeError):
43-
"""Custom exception for ProductInstance lifecycle errors."""
44-
45-
4644
class ProductInstance:
4745
"""Provides a wrapper for interacting with the launched product instance.
4846

0 commit comments

Comments
 (0)