title: Promise reject Possibly unhandled Error:
body: <p>I have a function that does some operation using an array. 
  I would like to reject it when the array is empty. </p>
  
  <p>As an example</p>
  
  <pre><code>myArrayFunction(){
          return new Promise(function (resolve, reject) {
             var a = new Array();
             //some operation with a
             if(a.length &gt; 0){
                 resolve(a);
             }else{
                 reject('Not found');
             }           
          };
  }
  </code></pre>
  
  <p>When the reject operation happens I get the following error.
  Possibly unhandled Error: Not found</p>
  
  <p>However I have the following catch when the call to myArrayFunction() is made.</p>
  
  <pre><code>handlers.getArray = function (request, reply) {
      myArrayFunction().then(
          function (a) {
              reply(a);
          }).catch(reply(hapi.error.notFound('No array')));
  };
  </code></pre>
  
  <p>What would be the correct way to reject the promise, catch the rejection and respond to the client? </p>
  
  <p>Thank you.</p>