Why does the below code print error msg instead of ABC\nerror msg?
class CustomException(Exception):
"""ABC"""
def __init__(self, *args):
super().__init__(*args)
self.__str__ = self._wrapper(self.__str__)
def _wrapper(self, f):
def _inner(*args, **kwargs):
return self.__doc__ + '\n' + f(*args, **kwargs)
return _inner
print(CustomException('error msg'))