Better messages and return codes in applications
Use stderr and return codes >0 when it makes sense. Loose return code conventions: * 1 for generic errors * 2 for user input errors * 3 for remote errors (not found, etc.) * 4 for not implemented
This commit is contained in:
parent
8155b0b289
commit
8075d538f0
18 changed files with 168 additions and 149 deletions
|
|
@ -113,6 +113,7 @@ class Weboorrents(ReplApplication):
|
|||
|
||||
if not found:
|
||||
print >>sys.stderr, 'Torrent "%s" not found' % id
|
||||
return 3
|
||||
else:
|
||||
self.flush()
|
||||
|
||||
|
|
@ -149,6 +150,7 @@ class Weboorrents(ReplApplication):
|
|||
return
|
||||
|
||||
print >>sys.stderr, 'Torrent "%s" not found' % id
|
||||
return 3
|
||||
|
||||
def do_search(self, pattern):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue