diff options
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); |