.. meta::
   :description: diwire errors examples: common exception types and how they surface.

Errors & troubleshooting
========================

What you'll learn
-----------------

- What the most common error categories look like at runtime.

Missing dependency error
------------------------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_16_errors_and_troubleshooting/01_missing_dependency_error.py

.. literalinclude:: ../../../examples/ex_16_errors_and_troubleshooting/01_missing_dependency_error.py
   :language: python
   :class: diwire-example py-run

Scope mismatch error
--------------------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_16_errors_and_troubleshooting/02_scope_mismatch_error.py

.. literalinclude:: ../../../examples/ex_16_errors_and_troubleshooting/02_scope_mismatch_error.py
   :language: python
   :class: diwire-example py-run

Async-in-sync error
-------------------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_16_errors_and_troubleshooting/03_async_in_sync_error.py

.. literalinclude:: ../../../examples/ex_16_errors_and_troubleshooting/03_async_in_sync_error.py
   :language: python
   :class: diwire-example py-run

Inference error
---------------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_16_errors_and_troubleshooting/04_inference_error.py

.. literalinclude:: ../../../examples/ex_16_errors_and_troubleshooting/04_inference_error.py
   :language: python
   :class: diwire-example py-run

Generic error
-------------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_16_errors_and_troubleshooting/05_generic_error.py

.. literalinclude:: ../../../examples/ex_16_errors_and_troubleshooting/05_generic_error.py
   :language: python
   :class: diwire-example py-run

Invalid registration error
--------------------------

Run locally
~~~~~~~~~~~

.. code-block:: bash

   uv run python examples/ex_16_errors_and_troubleshooting/06_invalid_registration_error.py

.. literalinclude:: ../../../examples/ex_16_errors_and_troubleshooting/06_invalid_registration_error.py
   :language: python
   :class: diwire-example py-run
