Helper method provided because we actually can't put that in the constructor, it creates a bug in Nose tests
        https://github.com/nose-devs/nose/issues/725

        :param parser_func:
        :param caught:
        :return:

def create(parser_func: Union[ParsingMethodForStream, ParsingMethodForFile], caught: Exception):
        """
        Helper method provided because we actually can't put that in the constructor, it creates a bug in Nose tests
        https://github.com/nose-devs/nose/issues/725

        :param parser_func:
        :param caught:
        :return:
        """
        msg = 'Caught TypeError while calling parsing function \'' + str(parser_func.__name__) + '\'. ' \
              'Note that the parsing function signature should be ' + parsing_method_stream_example_signature_str \
              + ' (streaming=True) or ' + parsing_method_file_example_signature_str + ' (streaming=False).' \
              'Caught error message is : ' + caught.__class__.__name__ + ' : ' + str(caught)
        return CaughtTypeError(msg).with_traceback(caught.__traceback__)