Error check for broken pipe