elasticio-sailor-nodejs 3.0.0-dev7 → 3.0.0-dev7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/sailor.js +20 -4
- package/package.json +1 -1
package/lib/sailor.js
CHANGED
|
@@ -393,13 +393,29 @@ class Sailor {
|
|
|
393
393
|
[bodyId, ...passthroughIds] = await Promise.all([
|
|
394
394
|
that.uploadMessageBody(bodyBuf),
|
|
395
395
|
...passthroughBufs.map(async ({ stepId, body, id }) => {
|
|
396
|
-
const
|
|
397
|
-
return { stepId, bodyId };
|
|
396
|
+
const newBodyId = id || await that.uploadMessageBody(body);
|
|
397
|
+
return { stepId, bodyId: newBodyId };
|
|
398
398
|
})
|
|
399
399
|
]);
|
|
400
400
|
} catch (e) {
|
|
401
|
-
logger.error(
|
|
402
|
-
|
|
401
|
+
logger.error(
|
|
402
|
+
{
|
|
403
|
+
errName: e && e.name,
|
|
404
|
+
errMessage: e && e.message,
|
|
405
|
+
errCode: e && e.code,
|
|
406
|
+
bodySize: bodyBuf.length,
|
|
407
|
+
passthroughCount: passthroughBufs.length,
|
|
408
|
+
passthroughInfo: passthroughBufs.map(({ stepId, id }) => ({
|
|
409
|
+
stepId,
|
|
410
|
+
hasExistingId: Boolean(id)
|
|
411
|
+
}))
|
|
412
|
+
},
|
|
413
|
+
'Error during message/passthrough body upload'
|
|
414
|
+
);
|
|
415
|
+
const details = e && e.message ? `: ${e.message}` : '';
|
|
416
|
+
return onError(
|
|
417
|
+
new Error(`Lightweight message/passthrough body upload error${details}`)
|
|
418
|
+
);
|
|
403
419
|
}
|
|
404
420
|
|
|
405
421
|
logger.info('Message body uploaded', { id: bodyId });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elasticio-sailor-nodejs",
|
|
3
3
|
"description": "The official elastic.io library for bootstrapping and executing for Node.js connectors",
|
|
4
|
-
"version": "3.0.0-dev7",
|
|
4
|
+
"version": "3.0.0-dev7.1",
|
|
5
5
|
"main": "run.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"audit": "better-npm-audit audit --level high --production",
|