fix-promises

You cannot use the same handler for rejecting and resolving. A transparent promise handler (like this) introduced in the promise chain should: 
```js
function onResolve(v) {
  //do whatever...
  return v;
}

function onReject(v) {
  //do whatever
  return $q.reject(v);
}
```

Otherwhise your returned promises always be resolved:
```js
var defer = $q.defer();
cache.put(q.promise).then(
  function onResolve(v) {
    console.log('always called');
  },
  function onReject(v) {
    console.log('never called');
  }
);

q.reject(new Error('Something went wrong');
```