(pouchdb/pouchdb#2546) - better error handling