Indicates that a read or write operation on JsonIOStream has failed.
| 25 | |
| 26 | |
| 27 | class JsonIOError(IOError): |
| 28 | """Indicates that a read or write operation on JsonIOStream has failed.""" |
| 29 | |
| 30 | def __init__(self, *args, **kwargs): |
| 31 | stream = kwargs.pop("stream") |
| 32 | cause = kwargs.pop("cause", None) |
| 33 | if not len(args) and cause is not None: |
| 34 | args = [str(cause)] |
| 35 | super().__init__(*args, **kwargs) |
| 36 | |
| 37 | self.stream = stream |
| 38 | """The stream that couldn't be read or written. |
| 39 | |
| 40 | Set by JsonIOStream.read_json() and JsonIOStream.write_json(). |
| 41 | |
| 42 | JsonMessageChannel relies on this value to decide whether a NoMoreMessages |
| 43 | instance that bubbles up to the message loop is related to that loop. |
| 44 | """ |
| 45 | |
| 46 | self.cause = cause |
| 47 | """The underlying exception, if any.""" |
| 48 | |
| 49 | |
| 50 | class NoMoreMessages(JsonIOError, EOFError): |
no outgoing calls
no test coverage detected
searching dependent graphs…