<filename>my_python_module/exceptions.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
python系统内的异常
 +-- Exception
      +-- StopIteration
      +-- StopAsyncIteration
      +-- ArithmeticError
      |    +-- FloatingPointError
      |    +-- OverflowError
      |    +-- ZeroDivisionError
      +-- AssertionError
      +-- AttributeError
      +-- BufferError
      +-- EOFError
      +-- ImportError
      |    +-- ModuleNotFoundError
      +-- LookupError
      |    +-- IndexError
      |    +-- KeyError
      +-- MemoryError
      +-- NameError
      |    +-- UnboundLocalError
      +-- OSError
      |    +-- BlockingIOError
      |    +-- ChildProcessError
      |    +-- ConnectionError
      |    |    +-- BrokenPipeError
      |    |    +-- ConnectionAbortedError
      |    |    +-- ConnectionRefusedError
      |    |    +-- ConnectionResetError
      |    +-- FileExistsError
      |    +-- FileNotFoundError
      |    +-- InterruptedError
      |    +-- IsADirectoryError
      |    +-- NotADirectoryError
      |    +-- PermissionError
      |    +-- ProcessLookupError
      |    +-- TimeoutError
      +-- ReferenceError
      +-- RuntimeError
      |    +-- NotImplementedError
      |    +-- RecursionError
      +-- SyntaxError
      |    +-- IndentationError
      |         +-- TabError
      +-- SystemError
      +-- TypeError
      +-- ValueError
      |    +-- UnicodeError
      |         +-- UnicodeDecodeError
      |         +-- UnicodeEncodeError
      |         +-- UnicodeTranslateError
      +-- Warning
           +-- DeprecationWarning
           +-- PendingDeprecationWarning
           +-- RuntimeWarning
           +-- SyntaxWarning
           +-- UserWarning
           +-- FutureWarning
           +-- ImportWarning
           +-- UnicodeWarning
           +-- BytesWarning
           +-- ResourceWarning
"""


class ConfigFileNotFoundError(FileNotFoundError):
    """
    The config file not found.
    """


class RequireArgumentError(Exception):
    """
    Require some argument
    """


class FatalError():
    """Fatal Error, the program need shutdown imediately"""


class NotIntegerError(ValueError):
    """Need input is a integer"""


class NotFloatError(ValueError):
    """Need input is a float"""


class OutOfRangeError(ValueError):
    """The input required a range"""


class OutOfChoiceError(ValueError):
    """The parameter is out of given choice"""


class NotSupportedWarning(UserWarning):
    """This feature is not supported, program will ignore it."""


class UnDefinedError():
    """UndefinedError, lately we will talk about it. """


class GuessFailed(Warning):
    """
    Your function do some guess operation but cause a failed, this is a warning.
    """

<filename>my_python_module/exceptions.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
python系统内的异常
 +-- Exception
      +-- StopIteration
      +-- StopAsyncIteration
      +-- ArithmeticError
      |    +-- FloatingPointError
      |    +-- OverflowError
      |    +-- ZeroDivisionError
      +-- AssertionError
      +-- AttributeError
      +-- BufferError
      +-- EOFError
      +-- ImportError
      |    +-- ModuleNotFoundError
      +-- LookupError
      |    +-- IndexError
      |    +-- KeyError
      +-- MemoryError
      +-- NameError
      |    +-- UnboundLocalError
      +-- OSError
      |    +-- BlockingIOError
      |    +-- ChildProcessError
      |    +-- ConnectionError
      |    |    +-- BrokenPipeError
      |    |    +-- ConnectionAbortedError
      |    |    +-- ConnectionRefusedError
      |    |    +-- ConnectionResetError
      |    +-- FileExistsError
      |    +-- FileNotFoundError
      |    +-- InterruptedError
      |    +-- IsADirectoryError
      |    +-- NotADirectoryError
      |    +-- PermissionError
      |    +-- ProcessLookupError
      |    +-- TimeoutError
      +-- ReferenceError
      +-- RuntimeError
      |    +-- NotImplementedError
      |    +-- RecursionError
      +-- SyntaxError
      |    +-- IndentationError
      |         +-- TabError
      +-- SystemError
      +-- TypeError
      +-- ValueError
      |    +-- UnicodeError
      |         +-- UnicodeDecodeError
      |         +-- UnicodeEncodeError
      |         +-- UnicodeTranslateError
      +-- Warning
           +-- DeprecationWarning
           +-- PendingDeprecationWarning
           +-- RuntimeWarning
           +-- SyntaxWarning
           +-- UserWarning
           +-- FutureWarning
           +-- ImportWarning
           +-- UnicodeWarning
           +-- BytesWarning
           +-- ResourceWarning
"""


class ConfigFileNotFoundError(FileNotFoundError):
    """
    The config file not found.
    """


class RequireArgumentError(Exception):
    """
    Require some argument
    """


class FatalError():
    """Fatal Error, the program need shutdown imediately"""


class NotIntegerError(ValueError):
    """Need input is a integer"""


class NotFloatError(ValueError):
    """Need input is a float"""


class OutOfRangeError(ValueError):
    """The input required a range"""


class OutOfChoiceError(ValueError):
    """The parameter is out of given choice"""


class NotSupportedWarning(UserWarning):
    """This feature is not supported, program will ignore it."""


class UnDefinedError():
    """UndefinedError, lately we will talk about it. """


class GuessFailed(Warning):
    """
    Your function do some guess operation but cause a failed, this is a warning.
    """

#!/usr/bin/env python # -*- coding: utf-8 -*- python系统内的异常  +-- Exception       +-- StopIteration       +-- StopAsyncIteration       +-- ArithmeticError       |    +-- FloatingPointError       |    +-- OverflowError       |    +-- ZeroDivisionError       +-- AssertionError       +-- AttributeError       +-- BufferError       +-- EOFError       +-- ImportError       |    +-- ModuleNotFoundError       +-- LookupError       |    +-- IndexError       |    +-- KeyError       +-- MemoryError       +-- NameError       |    +-- UnboundLocalError       +-- OSError       |    +-- BlockingIOError       |    +-- ChildProcessError       |    +-- ConnectionError       |    |    +-- BrokenPipeError       |    |    +-- ConnectionAbortedError       |    |    +-- ConnectionRefusedError       |    |    +-- ConnectionResetError       |    +-- FileExistsError       |    +-- FileNotFoundError       |    +-- InterruptedError       |    +-- IsADirectoryError       |    +-- NotADirectoryError       |    +-- PermissionError       |    +-- ProcessLookupError       |    +-- TimeoutError       +-- ReferenceError       +-- RuntimeError       |    +-- NotImplementedError       |    +-- RecursionError       +-- SyntaxError       |    +-- IndentationError       |         +-- TabError       +-- SystemError       +-- TypeError       +-- ValueError       |    +-- UnicodeError       |         +-- UnicodeDecodeError       |         +-- UnicodeEncodeError       |         +-- UnicodeTranslateError       +-- Warning            +-- DeprecationWarning            +-- PendingDeprecationWarning            +-- RuntimeWarning            +-- SyntaxWarning            +-- UserWarning            +-- FutureWarning            +-- ImportWarning            +-- UnicodeWarning            +-- BytesWarning            +-- ResourceWarning The config file not found. Require some argument Fatal Error, the program need shutdown imediately Need input is a integer Need input is a float The input required a range The parameter is out of given choice This feature is not supported, program will ignore it. UndefinedError, lately we will talk about it. Your function do some guess operation but cause a failed, this is a warning.