Hacker News new | ask | show | jobs
by _old_dude_ 1344 days ago
In Java, usually an Error like AssertionError is used for those cases.

By example, for a switch on an enum, the compiler inserts a "throw new ...Error()" automatically when the default case is not specified.