title: Getting error number of an exception object
body: <p>I have a program developed and it has a single entry point. A Try catch block is surrounding it.</p>
  
  <pre><code>try {
              Runner runner = new Runner();
              // Adhoc code
              UIManager.setLookAndFeel(new NimbusLookAndFeel());
              runner.setupVariables();
              runner.setLookAndFeel();
              runner.startSessionFactory();
              runner.setupApplicationVariables();
              runner.setupDirectories();
              // This will be used to test out frames in development mode
              if (Runner.isProduction == true) {
                  execute();
              } else {
                  test();
              }
          } catch (Exception e) {
                  SwingHelper.showErrorMessageMainFrame(e.getMessage());
              Logger.getRootLogger().error(e);
              e.printStackTrace();
          }
  </code></pre>
  
  <p>But suppose a null pointer exception is thrown, the message box is empty since the Exception doesn't contain a message. For this I added a logic-</p>
  
  <pre><code> if(e instanceof NullPointerException){
          NullPointerException n =(NullPointerException) e;
          SwingHelper.showErrorMessageMainFrame("Unexpected Exception due at ");
      }else{
  SwingHelper.showErrorMessageMainFrame(e.getMessage());
  }
  </code></pre>
  
  <p>This works all fine but I also want the line number to be displayed. How can I get it done. How can I get the line number of the exception?</p>