mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
uerrno: Document alongside OSError.
These are meant to be used together, so document them in the same place along with a practical example.
This commit is contained in:
@@ -967,15 +967,15 @@ class NotImplementedError(RuntimeError):
|
||||
|
||||
class OSError(Exception):
|
||||
"""
|
||||
This exception is raised when a system function returns a system-related
|
||||
error, including I/O failures.
|
||||
This exception is raised by the firmware, which is
|
||||
the Operating System that runs on the hub. For example, it
|
||||
raises an ``OSError`` if you call ``Motor(Port.A)`` when there is no
|
||||
motor on port A.
|
||||
"""
|
||||
|
||||
errno: _int
|
||||
"""
|
||||
A numeric error code.
|
||||
|
||||
Also see :mod:`uerrno`.
|
||||
Specifies which kind of ``OSError`` occurred, as listed below.
|
||||
"""
|
||||
|
||||
|
||||
@@ -1010,8 +1010,7 @@ class SyntaxError(Exception):
|
||||
|
||||
class SystemExit(BaseException):
|
||||
"""
|
||||
This exception is raised when the stop button is pressed (on the hub or in
|
||||
the IDE).
|
||||
Raised when you press the stop button on the hub or in the Pybricks Code app.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -61,9 +61,5 @@ The operation timed out.
|
||||
|
||||
errorcode: Dict[int, str]
|
||||
"""
|
||||
Dictionary mapping numeric error codes to strings with symbolic error
|
||||
code (see above)::
|
||||
|
||||
>>> print(uerrno.errorcode[uerrno.EEXIST])
|
||||
EEXIST
|
||||
Dictionary that maps numeric error codes to strings with symbolic error code.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user