我不知道在哪里可以找到访问远程Pouchdb失败的尝试。例如:
var testPouchDB = new PouchDB('http://remotedb-url/non-existant-db-name);
如果用户由于权限而无法创建该数据库,则会引发此错误:
CustomPouchError {status: 401, name: "unauthorized", message: "Name or password is incorrect.", error: true, reason: "You are not a server admin."}
正如开发工具所说的那样,我的构建设置可能隐藏了它的抛出位置undefined:1
,但是从API文档中我也无法弄清楚应该如何捕获数据库创建错误。
您可以这样做db.info()
,然后验证请求是否有效。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句