Network and http error handling.