title: How do I avoid Sonar's "preserve stack trace" violation?
body: <p><a href="http://www.sonarqube.org/" rel="nofollow">Sonar</a> gives a major violation error ("Preserve Stack Trace") for the following code. Following method is used to throw an exception. What are the steps should I take to overcome this violation?</p>
  
  <pre><code>public void exceptionHandler(String exception) throws PhDashException {
  
      String exceptionMsg = exception.replaceAll("-", "_");
  
      ExceptionPhDash pHDashExceptionMapper = new ExceptionPhDash();
      try {
          pHDashExceptionMapper = new ObjectMapper().readValue(exceptionMsg, ExceptionPhDash.class);
      } catch (JsonParseException e) {
          LOGGER.info(e.getMessage());
      } catch (JsonMappingException e) {
          LOGGER.info(e.getMessage());
      } catch (IOException e) {
          LOGGER.info(e.getMessage());
      }
      throw new PhDashException(pHDashExceptionMapper.getMessage());
  }
  </code></pre>