How to use the cup.err.BaseCupException function in cup

To help you get started, we’ve selected a few cup examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github baidu / CUP / cup / err.py View on Github external
def __init__(self, msg=''):
        BaseCupException.__init__(self, msg)
github baidu / CUP / cup / err.py View on Github external
"""
    def __init__(self, msg):
        super(self.__class__, self).__init__(msg)


# ## Log related exceptions ####
class LoggerException(BaseCupException):
    """
    Exception for logging, especially for cup.log
    """
    def __init__(self, msg):
        super(self.__class__, self).__init__(msg)


# ## Resouce related exceptions ####
class ResException(BaseCupException):
    """
    Resource releated Exception
    """
    def __init__(self, msg):
        BaseCupException.__init__(self, msg)


class NoSuchProcess(ResException):
    """
    No such Process Exception
    """
    def __init__(self, pid, str_process_name):
        ResException.__init__(self,
            'NoSuchProcess, pid %d, proc_name:%s' % (pid, str_process_name)
        )
github baidu / CUP / cup / err.py View on Github external
Network releated Exception
    """
    def __init__(self, msg=''):
        BaseCupException.__init__(self, msg)


class AsyncMsgError(NetException):
    """
    cup.net.async msg related Exception
    """
    def __init__(self, msg=''):
        NetException.__init__(self, msg)


# ## Shell related exceptions ####
class ShellException(BaseCupException):
    """
    Exception for cup.shell
    """
    def __init__(self, msg=''):
        BaseCupException.__init__(self, msg)


class IOException(BaseCupException):
    """
    IO related exceptions inside cup
    """
    def __init__(self, msg=''):
        BaseCupException.__init__(self, msg)


class NoSuchFileOrDir(IOException):
github baidu / CUP / cup / err.py View on Github external
'NoSuchProcess, pid %d, proc_name:%s' % (pid, str_process_name)
        )


class AccessDenied(ResException):
    """
    Access Denied
    """
    def __init__(self, str_resouce):
        ResException.__init__(self,
            'Resouce access denied: %s' % str_resouce
        )


# ## Net related exceptions ####
class NetException(BaseCupException):
    """
    Network releated Exception
    """
    def __init__(self, msg=''):
        BaseCupException.__init__(self, msg)


class AsyncMsgError(NetException):
    """
    cup.net.async msg related Exception
    """
    def __init__(self, msg=''):
        NetException.__init__(self, msg)


# ## Shell related exceptions ####
github baidu / CUP / cup / err.py View on Github external
cup.net.async msg related Exception
    """
    def __init__(self, msg=''):
        NetException.__init__(self, msg)


# ## Shell related exceptions ####
class ShellException(BaseCupException):
    """
    Exception for cup.shell
    """
    def __init__(self, msg=''):
        BaseCupException.__init__(self, msg)


class IOException(BaseCupException):
    """
    IO related exceptions inside cup
    """
    def __init__(self, msg=''):
        BaseCupException.__init__(self, msg)


class NoSuchFileOrDir(IOException):
    """
    No such file or directory
    """
    def __init__(self, msg=''):
        IOException.__init__(self, msg)


class ThreadTermException(BaseCupException):
github baidu / CUP / cup / util / conf.py View on Github external
print(ret['stdout'])
                break
            else:
                try_times += 1
                print('err:delkv')
                time.sleep(1)

            if(ret == 0 or try_times > 1):
                print(cmd)
                break
            else:
                time.sleep(1)
                try_times += 1


class ArrayFormatError(cup.err.BaseCupException):
    """
    array format error for Configure2Dict
    """
    def __init__(self, errmsg):
        super(self.__class__, self).__init__(errmsg)


class LineFormatError(cup.err.BaseCupException):
    """
    Line error class
    """
    def __init__(self, errmsg):
        super(self.__class__, self).__init__(errmsg)


class KeyFormatError(cup.err.BaseCupException):
github baidu / CUP / cup / util / conf.py View on Github external
"""
    value error class
    """
    def __init__(self, errmsg):
        super(self.__class__, self).__init__(errmsg)


class UnknowConfError(cup.err.BaseCupException):
    """
    unkown error class
    """
    def __init__(self, errmsg):
        super(self.__class__, self).__init__(errmsg)


class ConfDictSetItemError(cup.err.BaseCupException):
    """
    ConfDict Error
    """
    def __init__(self, errmsg):
        super(self.__class__, self).__init__(errmsg)


class ConfListSetItemError(cup.err.BaseCupException):
    """
    ConfList Error
    """
    def __init__(self, errmsg):
        super(self.__class__, self).__init__(errmsg)


class ConfList(list):
github baidu / CUP / cup / err.py View on Github external
def __str__(self):
        return repr(self._msg)


# ## Decorator Exceptions ####
class DecoratorException(BaseCupException):
    """
    DecoratorException
    """
    def __init__(self, msg):
        super(self.__class__, self).__init__(msg)


# ## Log related exceptions ####
class LoggerException(BaseCupException):
    """
    Exception for logging, especially for cup.log
    """
    def __init__(self, msg):
        super(self.__class__, self).__init__(msg)


# ## Resouce related exceptions ####
class ResException(BaseCupException):
    """
    Resource releated Exception
    """
    def __init__(self, msg):
        BaseCupException.__init__(self, msg)
github baidu / CUP / cup / err.py View on Github external
"""
    No such file or directory
    """
    def __init__(self, msg=''):
        IOException.__init__(self, msg)


class ThreadTermException(BaseCupException):
    """
        Thread termination error
    """
    def __init__(self, msg=''):
        BaseCupException.__init__(self, msg)


class NotInitialized(BaseCupException):
    """
    Not initialized yet
    """
    def __init__(self, msg=''):
        msg = 'Not initialized: %s' % msg
        BaseCupException.__init__(self, msg)


class LockFileError(BaseCupException):
    """
    LockFileError
    """
    def __init__(self, msg=''):
        msg = 'LockFileError: %s' % msg
        BaseCupException.__init__(self, msg)
github baidu / CUP / cup / err.py View on Github external
"""
    def __init__(self, expect, got):
        msg = 'expect failure, expect {0}, got {1}'.format(expect, got)
        BaseCupException.__init__(self, msg)


class NotImplementedYet(BaseCupException):
    """
    Not implemented yet
    """
    def __init__(self, msg=''):
        msg = 'The functionality is not implemented yet, {0}'.format(msg)
        BaseCupException.__init__(self, msg)


class ConfigError(BaseCupException):
    """
    ConfigError
    """
    def __init__(self, msg=''):
        msg = 'Configuration Error: {0}'.format(msg)
        BaseCupException.__init__(self, msg)