# Examples from pyvista.core.utilities.VtkErrorCatcher
# ====================================================

# 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()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

