What is the general rule of thumbs for creating an Exception in Java?

后端 未结 8 1112
悲哀的现实
悲哀的现实 2021-01-07 19:04

I have been in both situations:

  • Creating too many custom Exceptions
  • Using too many general Exception class

In both cases the project s

8条回答
  •  没有蜡笔的小新
    2021-01-07 19:15

    If I can't find an exception that has a name describing what type of error was caused then I make my own.

    That's my rule-o-thumb.

提交回复
热议问题