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

Method __init__

src/debugpy/common/messaging.py:868–887  ·  view source on GitHub ↗
(self, channel, seq, request, body, json=None)

Source from the content-addressed store, hash-verified

866 """
867
868 def __init__(self, channel, seq, request, body, json=None):
869 super().__init__(channel, seq, json)
870
871 self.request = request
872 """The request to which this is the response."""
873
874 if isinstance(body, MessageDict) and hasattr(body, "associate_with"):
875 body.associate_with(self)
876 self.body = body
877 """Body of the response if the request was successful, or an instance
878 of some class derived from Exception it it was not.
879
880 If a response was received from the other side, but request failed, it is an
881 instance of MessageHandlingError containing the received error message. If the
882 error message starts with InvalidMessageError.PREFIX, then it's an instance of
883 the InvalidMessageError specifically, and that prefix is stripped.
884
885 If no response was received from the other party before the channel closed,
886 it is an instance of NoMoreMessages.
887 """
888
889 def describe(self):
890 return f"#{self.seq} response to {self.request.describe()}"

Callers

nothing calls this directly

Calls 2

associate_withMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected