emabee/flexi_logger

GlobError unwrap happens

21pages opened this issue · 3 comments

rustdesk/rustdesk#3556 (comment)

Abort message: 'called Result::unwrap() on an Err value: GlobError { path: "/storage/emulated/0/RustDesk/Logs", error: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } }'

version: 0.25.6, maybe related to

let mut log_files: Vec<PathBuf> = glob::glob(pattern)

glob::glob(&pattern).unwrap(/*ok*/).map(Result::unwrap).collect();

Only the latter is critical, I think. The first one already does .filter_map(Result::ok), i.e., ignores errors silently.
The second one did .map(Result::unwrap), and now also does .filter_map(Result::ok).

If the PermissionDenied error is caused by glob::glob, does it mean there is no read directory permission?

I really do not know. Would be very much interested in more details.