title: Breezejs [Q] Unhandled rejection reasons (should be empty)
body: <p>These days,i have learned breezejs,durandaljs, so i made an spa application for excersizing,but breezejs(or q.js) often gives out errors</p>
  
  <blockquote>
    <p>[Q] Unhandled rejection reasons (should be empty): ["proto.saveChanges@http:...s/jquery-1.9.1.js:2750\n"] (<strong>Firefox</strong>)</p>
    
    <p>[Q] Unhandled rejection reasons (should be empty):(no stack) Error: Client side validation errors encountered - see the entityErrors collection on this object for more detail  (<strong>IE10, but why deleteing an entity triggers validation ?</strong>)</p>
  </blockquote>
  
  <p>I feel disappointed to use breezejs, what on earth am i doing!!!</p>
  
  <p>I just do  saving and deleting customer, sometimes error occured as above, sometimes works fine.(how confused i am feeling!  :'(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)</p>
  
  <p><strong>Here is part of my datacontext</strong></p>
  
  <blockquote>
  <pre><code>  var saveChanges = function () {
      return manager.saveChanges()
          .then(saveSuccess)
          .fail(saveFailure); //.done() does not work either
      //
      function saveSuccess() {
          console.log("Save Success!");
      }
      //
      function saveFailure(error) {
          console.log("Save Failure!");
          throw error;
      }
  };
  </code></pre>
  </blockquote>
  
  <p><strong>To save a customer:</strong></p>
  
  <blockquote>
  <pre><code>define(['modules/dataService'], function (datacontext) {
  </code></pre>
  </blockquote>
  
  <pre><code>var ctor = function () {
      this.entity = ko.observable();
  };
  
  ctor.prototype.activate = function () {
      //problem code --&gt; [Q] Unhandled rejection reasons (should be empty)
      //it will always create empty Customer when activate is called. 
      //so error occured when i switch in because of creating empty Customer every time.
      this.entity(datacontext.createEntity('Customer'));
  };
  
  ctor.prototype.saveClick = function () {
      if (this.entity().entityAspect.validateEntity())
          datacontext.saveChanges();
      else
          console.log('validation error!');
  };
  
  return ctor;
  </code></pre>
  
  <p>});</p>
  
  <p><strong>To delete a customer</strong></p>
  
  <blockquote>
    <p>define(function (require) {
        var datacontext = require('modules/dataService');
        var vm = {
            customers: ko.observableArray(),
            activate: function () {
                var self = this;
                return datacontext.getCustomers(self.customers);
            },
            deleteCustomer: deleteCustomer
        }; 
        return vm;
        //delete customer
        function deleteCustomer(customer) {
            vm.customers.remove(customer);
            //Sets the entity to an EntityState of 'Deleted'
            customer.entityAspect.setDeleted();
            datacontext.saveChanges();
        }
    });</p>
  </blockquote>
  
  <p>I think my code would work fine, but it can't!</p>
  
  <p>Where is the fatal error i make? plz let me know.</p>
  
  <p>Thanks in advance!</p>