We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ace473a commit 096fe63Copy full SHA for 096fe63
src/ansys/dpf/gate/errors.py
@@ -5,18 +5,12 @@ class DPFServerException(Exception):
5
"""Error raised when the DPF server has encountered an error."""
6
7
def __init__(self, msg=""):
8
- parties = [p.strip() for p in msg.split('<-')]
9
-
10
- if len(parties) >= 2:
11
- explicit = parties[-1]
12
- entities = parties[:-1]
13
- result = "<-".join(entities)
14
- else:
15
- explicit = msg.strip()
16
- result = ""
17
18
- Exception.__init__(self, explicit)
19
- self.add_note(result)
+ parts = msg.rsplit('<-', maxsplit=1)
+ error_message = parts[1]
+ error_note = parts[0]
+
+ Exception.__init__(self, error_message)
+ self.add_note(error_note)
20
21
22
class DPFServerNullObject(Exception):
0 commit comments