title: Magento: stopping the add to cart process in an observer?
body: <p>I am observing an event which is fired when a product is added to the cart. This is the tutorial I used for it: <a href="http://inchoo.net/ecommerce/magento/dispatching-before-and-after-events-to-magento-core-actions/" rel="nofollow">http://inchoo.net/ecommerce/magento/dispatching-before-and-after-events-to-magento-core-actions/</a></p>
  
  <p>Now under some conditions I want to stop the process of adding the product to the cart. I tried throwing an exception, but this gives me the <em>There has been an error processing your request</em> error message. Checking the report that is created by Magento does not tell me anything. How else could I stop the adding process?</p>
  
  <p>This is my code:</p>
  
  <pre><code>public function hookToAddToCartBefore($observer) {
      ...
      if(somecondition) {
           Mage::throwException('some message');
      }
  }
  </code></pre>