The code analyses the response for errors as well as determining whether it is an answer or a referral.