@ductape/sdk 0.1.158 → 0.2.0

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.
@@ -2980,7 +2980,7 @@ class ProcessorService {
2980
2980
  }
2981
2981
  this.requestTime += end - start;
2982
2982
  this.totalRequests += 1;
2983
- this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Process http request - failed', failed_execution: true, data: { e: error, input: payloads }, status: types_1.LogEventStatus.FAIL, app_id, action: event.event, start,
2983
+ this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Process http request - failed', failed_execution: true, data: { e: (0, processor_utils_1.redactSensitiveProcessorValue)(error), input: (0, processor_utils_1.redactSensitiveProcessorValue)(payloads) }, status: types_1.LogEventStatus.FAIL, app_id, action: event.event, start,
2984
2984
  end }));
2985
2985
  try {
2986
2986
  debugLog(e);
@@ -3137,7 +3137,7 @@ class ProcessorService {
3137
3137
  allow_fail,
3138
3138
  retry_at,
3139
3139
  retries_left,
3140
- payload: payload.payloads || event.input,
3140
+ payload: (0, processor_utils_1.redactSensitiveProcessorValue)(payload.payloads || event.input),
3141
3141
  error_code,
3142
3142
  reason,
3143
3143
  event,
@@ -5010,6 +5010,14 @@ class ProcessorService {
5010
5010
  recipient_workspace_id: bootstrapData.recipient_workspace_id,
5011
5011
  product_env_mapping: bootstrapData.product_env_mapping,
5012
5012
  });
5013
+ const processorFailure = (0, processor_utils_1.findProcessorFailureResult)(result);
5014
+ if (processorFailure) {
5015
+ throw Object.assign(new Error((0, processor_utils_1.processorFailureMessage)(processorFailure)), {
5016
+ code: processorFailure.error_code,
5017
+ processorFailure,
5018
+ processorFailureRecorded: this.published,
5019
+ });
5020
+ }
5013
5021
  this.end = Date.now();
5014
5022
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Execute action - success', data: { input, result }, status: types_1.LogEventStatus.SUCCESS }));
5015
5023
  await this.writeResult(types_1.LogEventStatus.SUCCESS);
@@ -5020,7 +5028,9 @@ class ProcessorService {
5020
5028
  if (this.logService) {
5021
5029
  this.logService.add(Object.assign(Object.assign(Object.assign({}, this.baseLogs), additional_logs), { message: 'Execute action - failed', data: { e: e.toString() }, status: types_1.LogEventStatus.FAIL }));
5022
5030
  this.end = Date.now();
5023
- await this.writeResult(types_1.LogEventStatus.FAIL);
5031
+ if (!(e === null || e === void 0 ? void 0 : e.processorFailureRecorded)) {
5032
+ await this.writeResult(types_1.LogEventStatus.FAIL);
5033
+ }
5024
5034
  await this.logService.publish();
5025
5035
  }
5026
5036
  throw e;