wrappedCallback = function(value) {
      try {
        return (callback || defaultCallback)(value);
      } catch (e) {
        exceptionHandler(e);
        return reject(e);
      }
    }
@ngdoc
@name ng.$q#when
@methodOf ng.$q
@description
Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
This is useful when you are dealing with on object that might or might not be a promise, or if
the promise comes from a source that can't be trusted.

@param {*} value Value or a promise
@returns {Promise} Returns a single promise that will be resolved with an array of values,
  each value coresponding to the promise at the same index in the `promises` array. If any of
  the promises is resolved with a rejection, this resulting promise will be resolved with the
  same rejection.