From 100492d98a199169a985086c20746dea7ff1fd3e Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Wed, 10 Sep 2008 20:05:45 +0000 Subject: 285: Started work on Command.args_to_kw() method; added unit test for functionality so far in args_to_kw() --- ipalib/errors.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ipalib/errors.py') diff --git a/ipalib/errors.py b/ipalib/errors.py index 5e8af9d4..a961ecb6 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -107,6 +107,19 @@ class IPAError(Exception): return self.format % self.args +class ArgumentError(IPAError): + """ + Raised when a command is called with wrong number of arguments. + """ + + format = '%s %s' + + def __init__(self, command, error): + self.command = command + self.error = error + IPAError.__init__(self, command.name, error) + + class ValidationError(IPAError): """ Base class for all types of validation errors. -- cgit