title: Java exception handling get console error message
body: <p>I want to get error message using java when exception are generated.</p>
  
  <p>now I have java code with following scenario:</p>
  
  <pre><code>method first(){
  
       try{
          second();
       }catch(Exception e){
          System.out.println("Error:&gt; "+e)
       }
  
  }
  </code></pre>
  
  <hr>
  
  <pre><code>method second(){
  
       try{
         my code
       }catch(Exception e){
          throw new Exception("Exception generate in second method",e);
       }
  
  }
  </code></pre>
  
  <p>now when the first method execute then I get only "Exception generate in second method" message but there is some other message printed on console by java so how to get that console error message.</p>
  
  <p>Note: I have already try with e.getMessage(); and e.printStackTrace();</p>