diff options
author | Robert HH <robert@hammelrath.com> | 2016-05-27 22:28:00 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-05-27 23:57:01 +0300 |
commit | 7c004e794c4b7f9c7eb0979cf1c8d608992afb1a (patch) | |
tree | f00adf160fe769eb206ee93482cc9a03f004e80a /extmod/vfs_fat_misc.c | |
parent | 751e3b7a820c13561cca47717d47d7784f776232 (diff) | |
download | micropython-7c004e794c4b7f9c7eb0979cf1c8d608992afb1a.tar.gz micropython-7c004e794c4b7f9c7eb0979cf1c8d608992afb1a.zip |
extmod/vfs_fat*: Replace text error messages by POSIX error numbers.
These changes are in line with similar changes in other modules, and
with standard Python interface.
Diffstat (limited to 'extmod/vfs_fat_misc.c')
-rw-r--r-- | extmod/vfs_fat_misc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/extmod/vfs_fat_misc.c b/extmod/vfs_fat_misc.c index 9b03f940ee..23fe4be88d 100644 --- a/extmod/vfs_fat_misc.c +++ b/extmod/vfs_fat_misc.c @@ -54,8 +54,9 @@ mp_obj_t fat_vfs_listdir(const char *path, bool is_str_type) { res = f_opendir(&dir, path); /* Open the directory */ if (res != FR_OK) { - // TODO should be mp_type_FileNotFoundError - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError, "No such file or directory: '%s'", path)); + nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, + MP_OBJ_NEW_SMALL_INT(fresult_to_errno_table[res]))); + } mp_obj_t dir_list = mp_obj_new_list(0, NULL); |