Change .then to comply with section 2.2.7.2 of the A+ specification:

if 'promise2 = promise1.then(onFulfilled, onRejected)' and 'either onFulfilled or onRejected throws an exception e, promise2 must be rejected with e as the reason'.  (Also changed the optional background process to reject promises with e instead of str(e), for consistency.)