2007-01-27 19:23:18 -05:00
|
|
|
"""
|
|
|
|
Exceptions Module
|
|
|
|
|
|
|
|
This module provides some simple but generally useful exception classes.
|
|
|
|
"""
|
|
|
|
|
|
|
|
class InvalidArgument(Exception):
|
|
|
|
"""Exception class for bad argument values."""
|
|
|
|
def __init__(self, argname, argval, explanation):
|
2007-12-13 23:06:55 -05:00
|
|
|
Exception.__init__(self)
|
2007-01-27 19:23:18 -05:00
|
|
|
self.argname, self.argval, self.explanation = argname, argval, explanation
|
|
|
|
def __str__(self):
|
|
|
|
return 'Bad argument value "%s" for %s: %s' % (self.argval, self.argname, self.explanation)
|