pyvista.core.utilities.VtkErrorCatcher

Contents

pyvista.core.utilities.VtkErrorCatcher#

class VtkErrorCatcher(raise_errors=False, send_to_logging=True)[source]#

Context manager to temporarily catch VTK errors.

Parameters:
raise_errorsbool, default: False

Raise a RuntimeError when a VTK error is encountered.

send_to_loggingbool, default: True

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

Examples

Catch VTK errors using the context manager.

>>> import pyvista as pv
>>> with pv.VtkErrorCatcher() as error_catcher:
...     sphere = pv.Sphere()
...

Methods