@aesop-fables/triginta 0.9.2 → 0.9.3
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/sqs/SqsLambda.js +12 -7
- package/package.json +1 -1
package/lib/sqs/SqsLambda.js
CHANGED
|
@@ -77,6 +77,15 @@ let SqsLambdaFactory = class SqsLambdaFactory {
|
|
|
77
77
|
const message = yield deserializer.deserializeMessage(record);
|
|
78
78
|
yield innerHandler.handle(message, record, event);
|
|
79
79
|
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
const failureHandler = childContainer.get(SqsLambdaServices_1.SqsLambdaServices.FailureHandler);
|
|
82
|
+
const shouldReport = yield failureHandler.onError(record, e);
|
|
83
|
+
if (shouldReport) {
|
|
84
|
+
response.batchItemFailures.push({
|
|
85
|
+
itemIdentifier: record.messageId,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
80
89
|
finally {
|
|
81
90
|
if (childContainer) {
|
|
82
91
|
try {
|
|
@@ -89,13 +98,9 @@ let SqsLambdaFactory = class SqsLambdaFactory {
|
|
|
89
98
|
}
|
|
90
99
|
}
|
|
91
100
|
catch (e) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
response.batchItemFailures.push({
|
|
96
|
-
itemIdentifier: record.messageId,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
101
|
+
// We need to revisit this
|
|
102
|
+
// https://github.com/aesop-fables/triginta/issues/199
|
|
103
|
+
throw e;
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
106
|
return response;
|
package/package.json
CHANGED