mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 17:14:41 +00:00
uerrno: Display on separate page.
Fixes https://github.com/pybricks/pybricks-api/issues/78
This commit is contained in:
@@ -121,6 +121,7 @@ Pybricks Documentation
|
||||
micropython/builtins
|
||||
micropython/exceptions
|
||||
micropython/micropython
|
||||
micropython/uerrno
|
||||
micropython/uio
|
||||
micropython/umath
|
||||
micropython/urandom
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
Exceptions and error codes
|
||||
Exceptions and errors
|
||||
=====================================================
|
||||
|
||||
|
||||
List of all exceptions
|
||||
----------------------
|
||||
|
||||
This section lists all available exceptions in alphabetical order.
|
||||
|
||||
.. autoclass:: ubuiltins.ArithmeticError
|
||||
@@ -55,11 +51,11 @@ This section lists all available exceptions in alphabetical order.
|
||||
.. autoclass:: ubuiltins.NotImplementedError
|
||||
:no-members:
|
||||
|
||||
.. _OSError:
|
||||
|
||||
.. autoclass:: ubuiltins.OSError
|
||||
:noindex:
|
||||
|
||||
See the `OSError`_ section for additional details.
|
||||
|
||||
.. autoclass:: ubuiltins.OverflowError
|
||||
:no-members:
|
||||
|
||||
@@ -84,37 +80,6 @@ This section lists all available exceptions in alphabetical order.
|
||||
.. autoclass:: ubuiltins.ZeroDivisionError
|
||||
:no-members:
|
||||
|
||||
.. _OSError:
|
||||
|
||||
Using ``OSError`` with :mod:`uerrno`
|
||||
------------------------------------
|
||||
|
||||
The ``errno`` attribute of an ``OSError`` indicates why the exception was
|
||||
raised. This attribute has one of the following values, which can be imported
|
||||
from the ``uerrno`` module. See also :ref:`this example <device_detection>`.
|
||||
|
||||
.. module:: uerrno
|
||||
|
||||
.. autodata:: uerrno.EAGAIN
|
||||
|
||||
.. autodata:: uerrno.EBUSY
|
||||
|
||||
.. autodata:: uerrno.ECANCELED
|
||||
|
||||
.. autodata:: uerrno.EINVAL
|
||||
|
||||
.. autodata:: uerrno.EIO
|
||||
|
||||
.. autodata:: uerrno.ENODEV
|
||||
|
||||
.. autodata:: uerrno.EOPNOTSUPP
|
||||
|
||||
.. autodata:: uerrno.EPERM
|
||||
|
||||
.. autodata:: uerrno.ETIMEDOUT
|
||||
|
||||
.. autodata:: uerrno.errorcode
|
||||
|
||||
Examples
|
||||
---------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
:mod:`uerrno <uerrno>` -- Error codes
|
||||
============================================================
|
||||
|
||||
.. module:: uerrno
|
||||
|
||||
The ``errno`` attribute of an :ref:`OSError <OSError>` indicates why this
|
||||
exception was raised. This attribute has one of the following values.
|
||||
See also :ref:`this example <device_detection>`.
|
||||
|
||||
.. autodata:: uerrno.EAGAIN
|
||||
|
||||
.. autodata:: uerrno.EBUSY
|
||||
|
||||
.. autodata:: uerrno.ECANCELED
|
||||
|
||||
.. autodata:: uerrno.EINVAL
|
||||
|
||||
.. autodata:: uerrno.EIO
|
||||
|
||||
.. autodata:: uerrno.ENODEV
|
||||
|
||||
.. autodata:: uerrno.EOPNOTSUPP
|
||||
|
||||
.. autodata:: uerrno.EPERM
|
||||
|
||||
.. autodata:: uerrno.ETIMEDOUT
|
||||
|
||||
.. autodata:: uerrno.errorcode
|
||||
@@ -968,14 +968,16 @@ class NotImplementedError(RuntimeError):
|
||||
class OSError(Exception):
|
||||
"""
|
||||
This exception is raised by the firmware, which is
|
||||
the Operating System that runs on the hub. For example, it
|
||||
the Operating System that runs on the hub.
|
||||
For :ref:`example <device_detection>`, it
|
||||
raises an ``OSError`` if you call ``Motor(Port.A)`` when there is no
|
||||
motor on port A.
|
||||
"""
|
||||
|
||||
errno: _int
|
||||
"""
|
||||
Specifies which kind of ``OSError`` occurred, as listed :ref:`here <OSError>`.
|
||||
Specifies which kind of ``OSError`` occurred, as listed in the
|
||||
:mod:`uerrno` module.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user