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:
Laurent Bachelier 2011-05-03 01:02:00 +02:00
commit 8075d538f0
18 changed files with 168 additions and 149 deletions

View file

@ -118,7 +118,7 @@ def main():
try:
script = imp.load_module("scripts.%s" % fname, f, tmpfile, desc)
except ImportError, e:
print >> sys.stderr, "Unable to load the %s script (%s)" \
print >>sys.stderr, "Unable to load the %s script (%s)" \
% (fname, e)
else:
print "Loaded %s" % fname