Catch all OSErrors when reading title.txt

Previously we only caught FileNotFoundError. If there was a
PermissionError for example, it would have percolated up and
stopped some background tasks.
このコミットが含まれているのは:
n9k 2022-06-13 03:46:48 +00:00
コミット 36666f8cdf
1個のファイルの変更2行の追加1行の削除

ファイルの表示

@ -20,7 +20,8 @@ async def get_stream_title():
try:
async with aiofiles.open(CONFIG['STREAM_TITLE']) as fp:
title = await fp.read(8192)
except FileNotFoundError:
except OSError as e:
print(f'WARNING: could not read stream title: {e}')
title = ''
return title