Skip to main content

subclass_exception

Create new exception class.

def subclass_exception(
name: str,
parent: type,
module: str
) - > type

Create new exception class.

Parameters

NameTypeDescription
namestrThe name of the new exception class to be created
parenttypeThe base exception class from which the new exception will inherit
modulestrThe module name to be assigned to the new exception's module attribute

Returns

TypeDescription
typeA new exception class derived from the specified parent, with its module attribute set to the provided module name