Correct exception to throw for an unhandled switch case for an argument?

后端 未结 5 2328
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-19 22:26

NOTE: This is different than the proposed duplicates as this deals with an argument rather than a value. The behavior and applicable scenarios are essentially different.

5条回答
  •  醉梦人生
    2021-02-19 22:29

    InvalidArgumentException. when user pass some invalid value or null value when value value is required, it is recommended to handle InvalidArgumentException .

提交回复
热议问题