title: Exceptions in apex class constructor
body: <p>I've been trying to catch an exception in a Salesforce custom apex class but doesn't seems to work. </p>
  
  <p>In this case I have a controller constructor that initializes the environment and I am trying to catch exceptions in the constructor, but doesn't work, the exception is not catched.</p>
  
  <pre><code>public MyController(){
    try{
      this.myVar = ApexPages.currentPage().getParameters().get('myParam');
      ....
  
     }
     catch( System.StringException se ){
       ..
     }
     catch( System.NullPointerException ne ){
       ..
     }
     catch( Exception e ){
       ..
     }
    ....
  }
  </code></pre>