What exception to throw when a property or a method being accessed is temporarily unavailable?

后端 未结 1 765
离开以前
离开以前 2021-01-21 11:39

What exception to throw when a property or a method being accessed is temporarily unavailable (as it makes no sense in the current state of the object)?

Following is a s

1条回答
  •  佛祖请我去吃肉
    2021-01-21 11:49

    java.lang.IllegalStateException

    Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation.

    0 讨论(0)
提交回复
热议问题