(self, channel, seq, request, body, json=None)
| 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()}" |
nothing calls this directly
no test coverage detected