A similar problem is that this also happens whenever the query contains a 5-digit number (https://schedules.gmu.edu/search?query=CS%2075005) and while this is less likely than entering the wrong CRN, its a reasonable mistake for a user to make.
In any case, only telling the user "an error has occured" could lead to more attempts to enter the same query, which will result in the same error every time.
For those unfamiliar with the codebase (like me) I suggest starting in app/controllers/search_controller.rb and looking for the code block with CourseSection.latest_by_crn
Entering in an invalid CRN brings the user to an error page instead of notifying the user that the course does not exist. (https://schedules.gmu.edu/search?query=99999)
A quick fix could be to simply serve the user to a "no course found" page (https://schedules.gmu.edu/search?query=ABC%20123) but it could also suggest courses 'close' to the incorrect CRN (https://schedules.gmu.edu/search?query=CS%2099)
A similar problem is that this also happens whenever the query contains a 5-digit number (https://schedules.gmu.edu/search?query=CS%2075005) and while this is less likely than entering the wrong CRN, its a reasonable mistake for a user to make.
In any case, only telling the user "an error has occured" could lead to more attempts to enter the same query, which will result in the same error every time.
For those unfamiliar with the codebase (like me) I suggest starting in
app/controllers/search_controller.rb
and looking for the code block withCourseSection.latest_by_crn