title: How to use a try catch to throw an exception when x = negative
body: <p>How to use a <code>try catch</code> to throw an exception when <code>x</code> = negative?</p>
  
  <p>For example all I have is:</p>
  
  <pre><code>try {
    if(DaysNum &gt; 0){
       return DaysNum;
    }
  }
  
  catch(...){
  }
  </code></pre>