Skip to content

Commit c61485b

Browse files
committed
Handle DPFServerException error (remote case)
1 parent 456e2cf commit c61485b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ansys/dpf/core/operators/operator.mustache

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Autogenerated DPF operator classes.
77
from __future__ import annotations
88

99
from warnings import warn
10+
from ansys.dpf.core.core import errors
1011
from ansys.dpf.core.dpf_operator import Operator
1112
from ansys.dpf.core.inputs import Input, _Inputs
1213
{{#outputs}}
@@ -89,8 +90,11 @@ class {{class_name}}(Operator):
8990
{{#has_internal_name_alias}}
9091
try:
9192
super().__init__(name="{{operator_name}}", config=config, server=server)
92-
except KeyError as e:
93-
super().__init__(name="{{internal_name_alias}}", config=config, server=server)
93+
except (KeyError, errors.DPFServerException) as e:
94+
if "doesn't exist in the registry" in str(e):
95+
super().__init__(name="{{internal_name_alias}}", config=config, server=server)
96+
else:
97+
raise e
9498
{{/has_internal_name_alias}}
9599
self._inputs = Inputs{{capital_class_name}}(self)
96100
self._outputs = Outputs{{capital_class_name}}(self)

0 commit comments

Comments
 (0)