Skip to content

Commit 1343f05

Browse files
committed
Refactor try-except in Field.deep_copy()
1 parent e1ef936 commit 1343f05

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/ansys/dpf/core/field.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -945,12 +945,18 @@ def deep_copy(self, server=None):
945945
raise e
946946
try:
947947
f.meshed_region = self.meshed_region.deep_copy(server=server)
948-
except Exception as e:
949-
raise e
948+
except DPFServerException as e:
949+
if "the field doesn't have this support type" in str(e):
950+
pass
951+
else:
952+
raise e
950953
try:
951954
f.time_freq_support = self.time_freq_support.deep_copy(server=server)
952-
except Exception as e:
953-
raise e
955+
except DPFServerException as e:
956+
if "the field doesn't have this support type" in str(e):
957+
pass
958+
else:
959+
raise e
954960

955961
return f
956962

0 commit comments

Comments
 (0)