pouchdb/pouchdb — pull request #2148 by mdebski (2014-05-04 17:11:19+00:00)
Title: (#2122) Improvements to replication EE api

At first I just created a test to recreate a problem, and I noticed that error is not emitted if a problem occurs while creating source or target PouchDB. So second commit fixes this, however it broke a few tests. It turned out that rejecting a promise without a error handler throws an UnhandlerError. I believe we should allow that, as we provide an alternative way of error handling - as object returned is also an EventEmitter.
As we don't - before my third commit - code you pasted would throw on error.

Please review, if you like it I will squash it into a single commit.