From 438e4df55bc9c3a66c893188df0aae4ca6447713 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 13 Aug 2023 17:27:22 +0300 Subject: [PATCH] Feat(torrent): Improve error messages --- torrent | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/torrent b/torrent index 0e396ee..7caff9b 100755 --- a/torrent +++ b/torrent @@ -218,15 +218,13 @@ def mctorrent_copyout(): break if torrent_filename in ('.META/private', '.META/piece length'): - if 'info' not in torrent: - torrent_error('Info absent') info = torrent['info'] if torrent_filename == '.META/private': if 'private' not in info: - torrent_error('Info absent') + torrent_error('Private absent') if torrent_filename == '.META/piece length': if 'piece length' not in info: - torrent_error('Info absent') + torrent_error('Piece length absent') data = str(info[torrent_filename[len('.META/'):]]) if not torrent_filename.startswith('.META/'): @@ -242,7 +240,8 @@ def mctorrent_copyout(): def mctorrent_copyin(): """Put a file to the VFS""" - sys.exit("Torrent VFS doesn't support adding files (read-only filesystem)") + sys.exit("Torrent VFS doesn't support adding/overwriting files " + "(read-only filesystem)") def mctorrent_rm(): -- 2.39.5