Skip to content

Commit 3058ac6

Browse files
committed
Add EmptyMeshPlottingError
1 parent 1b0421e commit 3058ac6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/ansys/dpf/core/errors.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
``fields_container[index]``.
4242
"""
4343

44+
_EMPTY_MESH_PLOTTING_MSG = """"
45+
The mesh support is empty.
46+
Either provide one to the plot function called, or use MeshedRegion.plot
47+
and provide the current data as parameter.
48+
"""
49+
4450

4551
class DpfValueError(ValueError):
4652
"""Error raised when a specific DPF error value must be defined."""
@@ -80,6 +86,13 @@ def __init__(self, msg=_FIELD_CONTAINER_PLOTTING_MSG):
8086
ValueError.__init__(self, msg)
8187

8288

89+
class EmptyMeshPlottingError(ValueError):
90+
"""Error raised when attempting to plot data with no mesh."""
91+
92+
def __init__(self, msg=_EMPTY_MESH_PLOTTING_MSG):
93+
ValueError.__init__(self, msg)
94+
95+
8396
class InvalidANSYSVersionError(RuntimeError):
8497
"""Error raised when the Ansys version is invalid."""
8598

0 commit comments

Comments
 (0)