Error when going to nonexisting course page

When changing the course ID in the browser URL bar, a server error occurs. I would expect a friendly 404 page.

error

Assignee Loading
Time tracking Loading