title: Spring Data MongoTemplate exceptions during save
body: <p>I have the following code to perform a save to Mongo from my Java application using Spring data.
  How do I handle exceptions that may happen during this save? This DAO method of mine is called from a ServiceImpl class.</p>
  
  <pre><code>public void saveDraftNote(Note draftNote) {
      try {
          mongoTemplate.save(draftNote);
      } catch (Exception e) {
          // TODO Error handling
      }
  }
  </code></pre>
  
  <p>Should I catch exception? Or catch specific exceptions? 
  How can I pass this to my ServiceImpl? Can I wrap the DAO exceptiosn into a custom ServiceException to handle in my ServiceImpl?</p>
  
  <p>Thanks
  Ram</p>