Add timeout for the request and catch more exceptions and print them if debug enabled in the conf