Catch timeout exception in http requests