Module 15Watt_Wsgi.Exceptions

The exceptions that can be thrown by the application.

If you like to create your own exception, please derive them from Base.

Expand source code
"""
    The exceptions that can be thrown by the application.

    If you like to create your own exception, please derive them from Base.
"""


class Base(Exception):
    """
    Base class of all Wsgi exceptions.
    """
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Internal server _error'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

    @property
    def returnCode(self) -> int:
        return self.__returnCode

    @property
    def returnMsg(self) -> str:
        return self.__returnMsg


class ProtocolException(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Protocol exception'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg


class ParamNotFound(Base):
    def __init__(self, returnCode: int = 400, returnMsg: str = 'Parameter not found'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg


class ValueNotFound(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Value not found'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg


class FileNotFound(Base):
    def __init__(self, returnCode: int = 404, returnMsg: str = 'File not found'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg


class NotAllowedHttpMethod(Base):
    def __init__(self, returnCode: int = 405, returnMsg: str = 'Not allowed HTTP method'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg


class NotAllowedHttpResponseCode(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not allowed HTTP response code'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg


class InvalidData(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Invalid data'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg


class NotUnique(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not unique'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg


class Unauthorized(Base):
    def __init__(self, returnCode: int = 401, returnMsg: str = 'Unauthorized'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Classes

class Base (returnCode: int = 500, returnMsg: str = 'Internal server _error')

Base class of all Wsgi exceptions.

Expand source code
class Base(Exception):
    """
    Base class of all Wsgi exceptions.
    """
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Internal server _error'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

    @property
    def returnCode(self) -> int:
        return self.__returnCode

    @property
    def returnMsg(self) -> str:
        return self.__returnMsg

Ancestors

  • builtins.Exception
  • builtins.BaseException

Subclasses

Instance variables

var returnCode : int
Expand source code
@property
def returnCode(self) -> int:
    return self.__returnCode
var returnMsg : str
Expand source code
@property
def returnMsg(self) -> str:
    return self.__returnMsg
class FileNotFound (returnCode: int = 404, returnMsg: str = 'File not found')

Base class of all Wsgi exceptions.

Expand source code
class FileNotFound(Base):
    def __init__(self, returnCode: int = 404, returnMsg: str = 'File not found'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException
class InvalidData (returnCode: int = 500, returnMsg: str = 'Invalid data')

Base class of all Wsgi exceptions.

Expand source code
class InvalidData(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Invalid data'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException
class NotAllowedHttpMethod (returnCode: int = 405, returnMsg: str = 'Not allowed HTTP method')

Base class of all Wsgi exceptions.

Expand source code
class NotAllowedHttpMethod(Base):
    def __init__(self, returnCode: int = 405, returnMsg: str = 'Not allowed HTTP method'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException
class NotAllowedHttpResponseCode (returnCode: int = 500, returnMsg: str = 'Not allowed HTTP response code')

Base class of all Wsgi exceptions.

Expand source code
class NotAllowedHttpResponseCode(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not allowed HTTP response code'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException
class NotUnique (returnCode: int = 500, returnMsg: str = 'Not unique')

Base class of all Wsgi exceptions.

Expand source code
class NotUnique(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not unique'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException
class ParamNotFound (returnCode: int = 400, returnMsg: str = 'Parameter not found')

Base class of all Wsgi exceptions.

Expand source code
class ParamNotFound(Base):
    def __init__(self, returnCode: int = 400, returnMsg: str = 'Parameter not found'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException
class ProtocolException (returnCode: int = 500, returnMsg: str = 'Protocol exception')

Base class of all Wsgi exceptions.

Expand source code
class ProtocolException(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Protocol exception'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException
class Unauthorized (returnCode: int = 401, returnMsg: str = 'Unauthorized')

Base class of all Wsgi exceptions.

Expand source code
class Unauthorized(Base):
    def __init__(self, returnCode: int = 401, returnMsg: str = 'Unauthorized'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException
class ValueNotFound (returnCode: int = 500, returnMsg: str = 'Value not found')

Base class of all Wsgi exceptions.

Expand source code
class ValueNotFound(Base):
    def __init__(self, returnCode: int = 500, returnMsg: str = 'Value not found'):
        self.__returnCode = returnCode
        self.__returnMsg = returnMsg

Ancestors

  • Base
  • builtins.Exception
  • builtins.BaseException