title: Throw my own exceptions?
body: <p>I have defined my own expection class:</p>
  
  <pre><code>public class ProduktException extends Exception {
  
      public ProduktException(String msg){
      //null
      }
  
      public static void throwProduktNotCreatedException() throws ProduktException {
          throw new ProduktException("Cannot be created!");
      }
  
      public static void throwProduktNotDeletedException () throws ProduktException {
          throw new ProduktException("Cannot be deleted!");
      }
  }
  </code></pre>
  
  <p>My Problem is I do not know how to throw them when I try:</p>
  
  <pre><code>try {
  ...
  } catch(ProduktNotDeletedException e) {
      e.toString();
  }
  </code></pre>
  
  <p>That does not work... But I want to have these structure! What is wrong?</p>
  
  <p>I appreaciate your answer!!!</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>My Problem is, I do not want to create several Exception Klasses I want to have all Exceptions in one class. Is there possibly a solution for that?</p>