MCPcopy Index your code
hub / github.com/nodejs/node / handle_exception

Method handle_exception

tools/inspector_protocol/jinja2/environment.py:760–780  ·  view source on GitHub ↗

Exception handling helper. This is used internally to either raise rewritten exceptions or return a rendered traceback for the template.

(self, exc_info=None, rendered=False, source_hint=None)

Source from the content-addressed store, hash-verified

758 return x
759
760 def handle_exception(self, exc_info=None, rendered=False, source_hint=None):
761 """Exception handling helper. This is used internally to either raise
762 rewritten exceptions or return a rendered traceback for the template.
763 """
764 global _make_traceback
765 if exc_info is None:
766 exc_info = sys.exc_info()
767
768 # the debugging module is imported when it's used for the first time.
769 # we're doing a lot of stuff there and for applications that do not
770 # get any exceptions in template rendering there is no need to load
771 # all of that.
772 if _make_traceback is None:
773 from jinja2.debug import make_traceback as _make_traceback
774 traceback = _make_traceback(exc_info, source_hint)
775 if rendered and self.exception_formatter is not None:
776 return self.exception_formatter(traceback)
777 if self.exception_handler is not None:
778 self.exception_handler(traceback)
779 exc_type, exc_value, tb = traceback.standard_exc_info
780 reraise(exc_type, exc_value, tb)
781
782 def join_path(self, template, parent):
783 """Join a template with the parent. By default all the lookups are

Callers 9

parseMethod · 0.95
lexMethod · 0.95
compileMethod · 0.95
compile_expressionMethod · 0.95
generate_asyncFunction · 0.45
render_asyncFunction · 0.45
renderMethod · 0.45
generateMethod · 0.45
renderMethod · 0.45

Calls 2

reraiseFunction · 0.90
exc_infoMethod · 0.80

Tested by

no test coverage detected