@staticmethod<EOL><INDENT>def create_for_caught_error(parser: _BaseParserDeclarationForRegistries, desired_type: Type[T],<EOL>obj: PersistedObject, caught: Exception, options: Dict[str, Dict[str, Any]]):<DEDENT>
try:<EOL><INDENT>typ = get_pretty_type_str(desired_type)<EOL><DEDENT>except:<EOL><INDENT>typ = str(desired_type)<EOL><DEDENT>e = ParsingException('<STR_LIT>' + str(obj) + '<STR_LIT>' + typ + '<STR_LIT>'<EOL>+ str(parser) + '<STR_LIT>' + str(options) + '<STR_LIT>'<EOL>+ str(caught.__class__.__name__) + '<STR_LIT>' + str(caught)).with_traceback(caught.__traceback__) <EOL>e.__cause__ = None<EOL>e.caught = caught<EOL>return e<EOL>
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:
:param desired_type:
:param obj:
:param caught:
:param options:
:return: