【发布时间】:2021-08-18 01:01:53
【问题描述】:
我正在使用 nodejs npm 模块 netsuite-rest 连接到 netsuite rest web 服务,我收到此错误:UnhandledPromiseRejectionWarning: Unhandled Promise Rejection。此错误源于在没有 catch 块的情况下在异步函数内部抛出
let NetSuiteRestlet = require('netsuite-restlet');
const config = {
account: 'XXXXX',
username: 'XXXXX',
password: 'XXXX',
role: 'FOM PH Sales Manager'
};
const url = 'https://6218235.suitetalk.api.netsuite.com';
const parameters = {
internalid: 1054
};
let ns = new NetSuiteRestlet(config);
// Example using the get function
ns.get(parameters, url).then((out) => { console.log(out) });
【问题讨论】: