Show
Ignore:
Timestamp:
09/27/05 20:34:31 (19 years ago)
Author:
jerome
Message:

Ensure that human made errors (like incorrect command line options)
don't produce a traceback anymore. No need to frighten users with
such complete tracebacks and email reporting each time they mistype
some command.
Makes pykosd check more carefully the values of its command line options.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkmail

    r2352 r2512  
    3131import email 
    3232 
    33 from pykota.tool import PyKotaTool, PyKotaToolError, crashed, N_ 
     33from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_ 
    3434     
    3535__doc__ = N_("""pkmail v%(__version__)s (c) %(__years__)s %(__author__)s 
     
    8787            (command, arguments) = (cmdargs[0].capitalize(), cmdargs[1:]) 
    8888        except IndexError :     
    89             raise PyKotaToolError, "No command found !" 
     89            raise PyKotaCommandLineError, "No command found !" 
    9090         
    9191        badchars = """/<>&"'#!%*$,;\\""" 
     
    159159    except KeyboardInterrupt :         
    160160        sys.stderr.write("\nInterrupted with Ctrl+C !\n") 
     161    except PyKotaCommandLineError, msg :     
     162        sys.stderr.write("%s : %s\n" % (sys.argv[0], msg)) 
    161163    except SystemExit :         
    162164        pass