Error handling for broken http connection