A clear explanation of system exception vs application exception

前端 未结 2 829
感动是毒
感动是毒 2020-12-12 20:52

The JPA spec differentiates between system exceptions and application exceptions. I am a bit confused about where the line is drawn exactly. My guesstimate:

An appli

2条回答
  •  借酒劲吻你
    2020-12-12 21:35

    I feel, I must add this very clear description, that Mahesh Desai gave on Coderanch :

    Any exception that is a subclass of Exception, but not a subclass of RuntimeException and RemoteException, is an application exception. All the application exceptions are checked exceptions, So, when we call another method in our method that can throw an application exception, we must either declare it in the throws clause of the calling method or catch it in the body of the calling method or both.

    All system exceptions are unchecked exceptions except RemoteExceptions and it can't be handled by the user.

提交回复
热议问题