Builditluc / wiki-tui

A simple and easy to use Wikipedia Text User Interface
https://wiki-tui.net/
MIT License
420 stars 14 forks source link

[BUG] crash on non writable directory #89

Closed nunotexbsd closed 1 year ago

nunotexbsd commented 2 years ago

General Information Version: 0.5.1 Installation Method: source Operating System: FreeBSD

Describe the bug Crashes when running on directory not writable (without write permission, not owner)

To Reproduce

mkdir readonly
chmod =ro,+X readonly
cd readonly
wiki-tui

thread panicked while processing panic. aborting.
Abort

Expected behavior Run normally

Screenshots If applicable, add screenshots to help explain your problem.

Crash report (if available)

thread panicked while processing panic. aborting.
Abort

Additional context I suspect it's related to trying to create wiki-tui.log.

Checklist

Builditluc commented 1 year ago

Thank you for your bug report! I've created and uploaded a patch that fixes the crash. Now, when wiki-tui cannot write the log file, it will print out this error message to stdout and continue running normally

wiki-tui/readonly🔒  bug/fix-cr
$  ../target/release/wiki-tui
Error: failed initializing the logger

Caused by:
    0: failed building the FileAppender
    1: Permission denied (os error 13)