uerrno – system error codes¶
This module implements a subset of the corresponding CPython module,
as described below. For more information, refer to the original
CPython documentation: errno.
This module provides access to symbolic error codes for OSError exception.
A particular inventory of codes depends on MicroPython port.
Constants¶
- EEXIST, EAGAIN, etc.
Error codes, based on ANSI C/POSIX standard. All error codes start with “E”. As mentioned above, inventory of the codes depends on
MicroPython port. Errors are usually accessible asexc.args[0]whereexcis an instance ofOSError. Usage example:try: uos.mkdir("my_dir") except OSError as exc: if exc.args[0] == uerrno.EEXIST: print("Directory already exists")
- EPERM = 1
- ENOENT = 2
- EIO = 5
- EBADF = 9
- EAGAIN = 11
- ENOMEM = 12
- EACCES = 13
- EEXIST = 17
- ENODEV = 19
- EISDIR = 21
- EINVAL = 22
- EOPNOTSUPP = 95
- EADDRINUSE = 98
- ECONNABORTED = 103
- ECONNRESET = 104
- ENOBUFS = 105
- ENOTCONN = 107
- ETIMEDOUT = 110
- ECONNREFUSED = 111
- EHOSTUNREACH = 113
- EALREADY = 114
- EINPROGRESS = 115
- uerrno.errorcode¶
Dictionary mapping numeric error codes to strings with symbolic error code (see above):
>>> print(uerrno.errorcode[uerrno.EEXIST]) EEXIST