handle res.writeHead exceptions