title: Why do I NOT need to catch certain exceptions in a Spring Boot MVC application?
body: <p>I have a simple Spring Boot MVC application, in which I would like to throw exceptions from the service layer.  I handle those exceptions in the controller with a series of @ExceptionHandler annotated methods.</p>
  <p>I do not understand why some of the exceptions do not need to be declared as thrown while some do.  For instance, if I simply throw a</p>
  <p><code>java.sql.SQLIntegrityConstraintViolationException</code></p>
  <p>the compiler complains with:</p>
  <p><code>java: unreported exception java.sql.SQLIntegrityConstraintViolationException; must be caught or declared to be thrown</code></p>
  <p>whereas if I throw a</p>
  <p><code>org.springframework.dao.DataIntegrityViolationException</code></p>
  <p>I neither need to declare it to be thrown, nor to catch it in the controller.  It simply gets taken care of by my ExceptionHandler.</p>
  <p>What's the difference?  And better yet, where may I find documentation on this?</p>