Catch connection errors, sleep time is float, remove whitespace.