]> git.phdru.name Git - extfs.d.git/commitdiff
Feat(torrent): Improve error messages
authorOleg Broytman <phd@phdru.name>
Sun, 13 Aug 2023 14:27:22 +0000 (17:27 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 13 Aug 2023 14:32:02 +0000 (17:32 +0300)
torrent

diff --git a/torrent b/torrent
index 0e396ee4b3f38fc4fd14ab00655060f891c3380e..7caff9b497f40b3f0374e2d1517e0389d9ae5fdc 100755 (executable)
--- 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():