Attempt reconnect after failed stream.write

I feel like there should be a more pythonic way to do this than to nest try-except statements but nothing I've found on the internet is any better. Any ideas @rtjoseph11?