I think it would be more sensible to raise an exception and handle it appropriately in higher layers (which right now would just be test code and the index_course view).