MCPcopy Create free account
hub / github.com/microsoft/debugpy / _exception

Function _exception

src/debugpy/common/log.py:180–199  ·  view source on GitHub ↗
(format_string="", *args, **kwargs)

Source from the content-addressed store, hash-verified

178
179
180def _exception(format_string="", *args, **kwargs):
181 level = kwargs.pop("level", "error")
182 exc_info = kwargs.pop("exc_info", sys.exc_info())
183
184 if format_string:
185 format_string += "\n\n"
186 format_string += "{exception}\nStack where logged:\n{stack}"
187
188 exception = "".join(traceback.format_exception(*exc_info))
189
190 f = inspect.currentframe()
191 f = f.f_back if f else f # don't log this frame
192 try:
193 stack = "".join(traceback.format_stack(f))
194 finally:
195 del f # avoid cycles
196
197 write_format(
198 level, format_string, *args, exception=exception, stack=stack, **kwargs
199 )
200
201
202def swallow_exception(format_string="", *args, **kwargs):

Callers 2

swallow_exceptionFunction · 0.85
reraise_exceptionFunction · 0.85

Calls 3

write_formatFunction · 0.85
popMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…