title: Custom Exception in scala
body: <p>how can i create custom exceptions in Scala extending <code>Exception</code> class and throw them when exception occurs as well as catch them.</p>
  
  <p>example in java :</p>
  
  <pre><code>class CustomException extends Exception {
  
    public final static String _FAIL_TO_INSERT = "FAIL_TO_INSERT";
  
  }
  </code></pre>