#!/usr/bin/env python
# -*- coding: utf-8 -*-


class InsufficientArgs(Exception):

    def __init__(self, func, manarg, argnum):
        self.func = func
        self.manarg = manarg
        self.argnum = argnum 

    def __str__(self):
        msg = ("%s expected at least %d arguments, got %d" % 
               (self.func, self.manarg, self.argnum))
        return msg

 
class InvalidArg(Exception):

    def __init__(self, func, argname, argtype):
        self.func = func
        self.argname = argname
        self.argtype = argtype

    def __str__(self):
        msg = "%s: %s must be a %s" % (self.func, argname, argtype)
        return msg

class InvalidType(Exception):

    def __init__(self, func, argname):
        self.func = func
        self.argname = argname

    def __str__(self):
        msg = "%s: Invalid type %s" % (self.func, self.argname)
        return msg


#!/usr/bin/env python
# -*- coding: utf-8 -*-


class InvalidArg(TypeError):
    '''
    Exception class that is raised to handle bad arguments passed.

    @type arg_type: <type 'type'>
    @param arg_type: The type that was passed and resulted in exeception being
                     raised.
    '''
    def __init__(self, arg_type):
        super(InvalidArg, self).__init__(arg_type)


class InvalidSQLType(ValueError):
    '''
    Exception class that is raised to handle bad sqlite types passed.

    @type values: <type 'str'>
    @param values: A string of the columns type names that were passed and
                   resulted in the exeception being raised.
    '''
    def __init__(self, values):
        super(InvalidSQLType, self).__init__(values)

Refactor exeception handling