pyvista.core.utilities.VtkErrorCatcher#
- class VtkErrorCatcher( )[source]#
Context manager to temporarily catch VTK errors.
- Parameters:
- raise_errorsbool, default:
False Raise a
pyvista.VTKExecutionError(a runtime error) when a VTK error is observed.Changed in version 0.47: A
pyvista.VTKExecutionErroris now raised instead of a genericRuntimeError.- send_to_loggingbool, default:
True Determine whether VTK errors raised within the context should also be sent to logging.
- emit_warningsbool, default:
False Emit a
pyvista.VTKExecutionWarning(a runtime warning) when a VTK warning is observed.Added in version 0.47.
- raise_errorsbool, default:
Examples
Catch VTK errors using the context manager. This only sends to logging by default.
>>> import pyvista as pv >>> with pv.VtkErrorCatcher() as error_catcher: ... sphere = pv.Sphere()
Raise VTK errors as Python errors and emit VTK warnings as Python warnings.
>>> with pv.VtkErrorCatcher( ... raise_errors=True, emit_warnings=True ... ) as error_catcher: ... sphere = pv.Sphere()
Methods#
Attributes#
List of VTK error events observed. |
|
List of all VTK warning and error events observed. |
|
List of VTK error events observed. |