Throwing exceptions in switch statements when no specified case can be handled
Solution 1:
I always throw an exception in this case. Consider using InvalidEnumArgumentException
, which gives richer information in this situation.
Solution 2:
With what you have it is fine although the break statement after it will never be hit because execution of that thread will cease when an exception is thrown and unhandled.