In PouchDB, when I put
a document, I can manage the response and any errors in a Promise structure:
db.put(doc).then(function(response) {
console.log(response);
}).catch(function(err) {
console.log(err);
});
Can a similar approach be taken when creating the database?
The documentation says
const db = new PouchDB('dbname');
And the only upvoted (and accepted) answer to How do you catch errors on PouchDB creation? is effectively ‘Use db.info()
‘.
Can I wrap the creation of a Pouch database in a Promise so that it’s result is then
able and failure is catch
able?