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

Method _handle

src/debugpy/common/messaging.py:578–601  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

576 channel._enqueue_handlers(message, message._handle)
577
578 def _handle(self):
579 channel = self.channel
580 handler = channel._get_handler_for("event", self.event)
581 try:
582 try:
583 result = handler(self)
584 assert (
585 result is None
586 ), f"Handler {util.srcnameof(handler)} tried to respond to {self.describe()}."
587 except MessageHandlingError as exc:
588 if not exc.applies_to(self):
589 raise
590 log.error(
591 "Handler {0}\ncouldn't handle {1}:\n{2}",
592 util.srcnameof(handler),
593 self.describe(),
594 str(exc),
595 )
596 except Exception:
597 log.reraise_exception(
598 "Handler {0}\ncouldn't handle {1}:",
599 util.srcnameof(handler),
600 self.describe(),
601 )
602
603
604NO_RESPONSE = object()

Callers

nothing calls this directly

Calls 4

describeMethod · 0.95
_get_handler_forMethod · 0.80
applies_toMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected