Handle situation when SAM API goes offline while waiting for reply
parent
5595cf658e
commit
1e1fc4c750
|
@ -8,6 +8,9 @@ import i2plib.utils
|
|||
BUFFER_SIZE = 65536
|
||||
|
||||
def parse_reply(data):
|
||||
if not data:
|
||||
raise ConnectionAbortedError("Empty response: SAM API went offline")
|
||||
|
||||
return i2plib.sam.Message(data.split(b"\n")[0].decode())
|
||||
|
||||
async def get_sam_socket(sam_address=i2plib.sam.DEFAULT_ADDRESS, loop=None):
|
||||
|
|
Loading…
Reference in New Issue