Add timeout and error handling
If there are network connection issues we might lose logs so we print the errors and add a timeout to the request.
If there are network connection issues we might lose logs so we print the errors and add a timeout to the request.