在快速入门和 bulkReadDocuments 的示例代码中获取 "UnhandledPromiseRejectionWarning: Error"
Getting "UnhandledPromiseRejectionWarning: Error" in quick start and in example code for bulkReadDocuments
使用 Domino AppDev Pack 文档中的 快速入门,我得到一个错误:
(node:46496) UnhandledPromiseRejectionWarning: Error
at new DominoDbError (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\src\domino-db-error.js:6:16)
at wrapError (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\src\requests\grpc\utils\grpc-helpers.js:124:10)
at client.bulkNote (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\src\requests\grpc\utils\bulk-document.js:157:18)
at Object.onReceiveStatus (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\node_modules\grpc\src\client_interceptors.js:1189:9)
at InterceptingListener._callNext (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\node_modules\grpc\src\client_interceptors.js:564:42)
at InterceptingListener.onReceiveStatus (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\node_modules\grpc\src\client_interceptors.js:614:8)
at callback (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\node_modules\grpc\src\client_interceptors.js:841:24)
(node:46496) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:46496) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
行中出现错误:
const response = await database.bulkCreateDocuments(createOptions);
我在 database.bulkReadDocuments
.
的示例代码中遇到了同样的错误
要找到更好的错误消息,您应该捕获抛出的错误。
try {
const response = await database.bulkCreateDocuments(createOptions);
} catch (e) {
console.error(e);
}
使用 Domino AppDev Pack 文档中的 快速入门,我得到一个错误:
(node:46496) UnhandledPromiseRejectionWarning: Error
at new DominoDbError (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\src\domino-db-error.js:6:16)
at wrapError (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\src\requests\grpc\utils\grpc-helpers.js:124:10)
at client.bulkNote (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\src\requests\grpc\utils\bulk-document.js:157:18)
at Object.onReceiveStatus (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\node_modules\grpc\src\client_interceptors.js:1189:9)
at InterceptingListener._callNext (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\node_modules\grpc\src\client_interceptors.js:564:42)
at InterceptingListener.onReceiveStatus (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\node_modules\grpc\src\client_interceptors.js:614:8)
at callback (C:\Users\tbahn\AppData\Roaming\npm\node_modules\@domino\domino-db\node_modules\grpc\src\client_interceptors.js:841:24)
(node:46496) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:46496) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
行中出现错误:
const response = await database.bulkCreateDocuments(createOptions);
我在 database.bulkReadDocuments
.
要找到更好的错误消息,您应该捕获抛出的错误。
try {
const response = await database.bulkCreateDocuments(createOptions);
} catch (e) {
console.error(e);
}