NXP-13464: Do not set cache on response if an exception was raised and redirect to CAS if exception occurs in an anonymous session