我有一个创建新客户的 lambda 函数(AWS),为了跟踪一些指标,我需要这个包https://www.npmjs.com/package/node-klaviyo。在每约 50 个请求中,我都会在我的云监视日志中看到此错误。它与这个包有什么关系?提前致谢!
错误
{
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "Error: Client network socket disconnected before secure TLS connection was established",
"reason": {
"errorType": "Error",
"errorMessage": "Client network socket disconnected before secure TLS connection was established",
"code": "ECONNRESET",
"path": null,
"host": "a.klaviyo.com",
"port": 443,
"stack": [
"Error: Client network socket disconnected before secure TLS connection was established",
" at connResetException (internal/errors.js:609:14)",
" at TLSSocket.onConnectEnd (_tls_wrap.js:1549:19)",
" at Object.onceWrapper (events.js:420:28)",
" at TLSSocket.emit (events.js:326:22)",
" at TLSSocket.EventEmitter.emit (domain.js:483:12)",
" at endReadableNT (_stream_readable.js:1241:12)",
" at processTicksAndRejections (internal/process/task_queues.js:84:21)"
]
},
"promise": {},
"stack": [
"Runtime.UnhandledPromiseRejection: Error: Client network socket disconnected before secure TLS connection was established",
" at process.<anonymous> (/var/runtime/index.js:35:15)",
" at process.emit (events.js:326:22)",
" at process.EventEmitter.emit (domain.js:483:12)",
" at processPromiseRejections (internal/process/promises.js:209:33)",
" at processTicksAndRejections (internal/process/task_queues.js:98:32)"
]
}
文件:utils/klaviyoClient
const Klaviyo = require('node-klaviyo');
const KlaviyoClient = new Klaviyo({
publicToken: process.env.KLAVIYO_PUBLIC_TOKEN,
privateToken: process.env.KLAVIYO_PRIVATE_TOKEN,
});
module.exports = KlaviyoClient;