Skip to content

Commit 4833a58

Browse files
committed
Silently handle directory read failures
1 parent fc90479 commit 4833a58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Terminal/Widgets/Volatile/DirTree.rakumod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ class Dir does Node {
4848
# XXXX: For now, just fake real caching and be lazy
4949
if $refresh || !$!cache-time {
5050
$!cache-time = now;
51-
@!children = $!path.dir.map: {
51+
52+
# Directory read may fail due to insufficient permissions
53+
try my @entries = $!path.dir;
54+
55+
@!children = @entries.map: {
5256
.d ?? Dir.new( parent => self, path => $_) !!
5357
.l ?? SymLink.new(parent => self, path => $_, target => .readlink) !!
5458
.f ?? File.new( parent => self, path => $_) !!

0 commit comments

Comments
 (0)