Throw an appropriate error when trying to add an undefined view