Catch AssertionError in case Swift cannot connect to TCP socket and restart Swift