pyvista.utilities.VtkErrorCatcher

class VtkErrorCatcher(raise_errors=False, send_to_logging=True)

Context manager to temporarily catch VTK errors.

Parameters
raise_errorsbool, optional

Raise a RuntimeError when a VTK error is encountered. Defaults to False.

send_to_loggingbool, optional

Determine whether VTK errors raised within the context should also be sent to logging. Defaults to True.

Examples

Catch VTK errors using the context manager.

>>> import pyvista
>>> with pyvista.VtkErrorCatcher() as error_catcher:
...     sphere = pyvista.Sphere()
__init__(raise_errors=False, send_to_logging=True)

Initialize context manager.

Methods

__init__([raise_errors, send_to_logging])

Initialize context manager.