New Maix series products MaixCAM online now, and new MaixPy,feature richer functionalities, enhanced performance, and user-friendly software, with comprehensive documentationx

uerrno — system error code

This module implements a subset of the corresponding CPython module, as described below. For more information, please refer to the original CPython documentation: errno.

This module describes the error identifier of the OSError error. The specific code inventory depends on Micropython porting, and the error will be explained in the specific error function.

1. Constant#

1.1. EEXIST, EAGAIN, etc.#

Error codes based on ANSI C / POSIX standards. All error codes begin with "E". As mentioned above, the code inventory depends on the port of MicroPython. Errors can usually be accessed as exc.args[0], where exc is an instance of OSError. Example usage:

try:
    uos.mkdir("my_dir")
except OSError as exc:
    if exc.args[0] == uerrno.EEXIST:
        print("Directory already exists")

1.2. uerrno.errorcode#

The dictionary maps numeric error codes to strings with signed error codes (see above):

>>> print(uerrno.errorcode[uerrno.EEXIST])
EEXIST

Related Issues not found

Please login GitHub to create issue