Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions ansys/dpf/core/errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
from grpc._channel import _InactiveRpcError, _MultiThreadedRendezvous

_COMPLEX_PLOTTING_ERROR_MSG = """
Complex fields can not be plotted. Use operators to get the amplitude
or the result at a defined sweeping phase before plotting.
"""

_FIELD_CONTAINER_PLOTTING_MSG = """"
This fields_container contains multiple fields. Only one time-step
result can be plotted at a time. Extract a field with
``fields_container[index]``.
"""


class ComplexPlottingError(ValueError):
"""Raised when attempting to plot a field with complex data"""

def __init__(self, msg=_COMPLEX_PLOTTING_ERROR_MSG):
ValueError.__init__(self, msg)


class FieldContainerPlottingError(ValueError):
"""Raised when attempting to plot a fields_container containing
multiple fields."""

def __init__(self, msg=_FIELD_CONTAINER_PLOTTING_MSG):
ValueError.__init__(self, msg)


class InvalidANSYSVersionError(RuntimeError):
"""Raised when ANSYS is an invalid version"""
Expand Down
Loading