mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #659] In the treeview example (demos) when the directory visited does not have read permission, the app crashes #484
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#484
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @serge-hulne on GitHub (Sep 30, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/659
In the treeview example (demos) when the directory visited does not have read permission, the app crashes :
https://github.com/rivo/tview/tree/master/demos/treeview
@rivo commented on GitHub (Sep 30, 2021):
I know. I wouldn't say it crashes, it panics. It's not meant to be a fully featured file browser. It just demonstrates the use of the
TreeViewprimitive.@serge-hulne commented on GitHub (Sep 30, 2021):
Thanks!
How could I catch this exception?
@rivo commented on GitHub (Sep 30, 2021):
It's uncommon to catch panics in Golang. You'll need to decide what to do with a directory for which you don't have permission, then do that instead of panicking. This is where it happens:
github.com/rivo/tview@ee97a7ab39/demos/treeview/main.go (L26)@serge-hulne commented on GitHub (Sep 30, 2021):
Thank you!