Catch HTTP socket closed error