trap errors somewhat more sanely
closing the upstream if the client request has disappeared