Checked vs. Unchecked Exceptions in Service Layer

前端 未结 5 805
自闭症患者
自闭症患者 2020-12-13 10:59

I work on a project with a legacy service layer that returns null in many places if a requested record does not exist, or cannot be accessed due to the caller not being auth

5条回答
  •  时光取名叫无心
    2020-12-13 11:50

    I could be wrong, but it might be connected to the way EJB container handles exceptions. From Best practices in EJB exception handling:

    To use the EJB container's internal housekeeping, you will have to have your checked exceptions thrown as unchecked exceptions.

提交回复
热议问题