Skip to content

Commit 965cb45

Browse files
committed
fix: ensure that captured errors during business rule evaluation are being captured and logged
1 parent fb30b1f commit 965cb45

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

  • src/dve/core_engine/backends/base

src/dve/core_engine/backends/base/rules.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def _step_metadata_to_location(step_metadata: "AbstractStep") -> str:
172172

173173
def _handle_rule_error(self, error: Exception, config: AbstractStep) -> Messages:
174174
"""Log an error and create appropriate error messages."""
175-
return render_error(error, self._step_metadata_to_location(config))
175+
return render_error(error, self._step_metadata_to_location(config), self.logger)
176176

177177
def evaluate(self, entities, *, config: AbstractStep) -> tuple[Messages, StageSuccessful]:
178178
"""Evaluate a step definition, applying it to the entities."""
@@ -411,7 +411,7 @@ def apply_sync_filters(
411411
CriticalProcessingError(
412412
"Issue occurred while applying filter logic",
413413
messages=[
414-
msg.error_message
414+
msg.error_message # type: ignore
415415
for msg in temp_messages
416416
if msg.error_message
417417
],
@@ -439,7 +439,10 @@ def apply_sync_filters(
439439
[
440440
CriticalProcessingError(
441441
"Issue occurred while generating FeedbackMessages",
442-
[msg.error_message for msg in temp_messages],
442+
messages=[
443+
msg.error_message # type: ignore
444+
for msg in temp_messages
445+
],
443446
)
444447
],
445448
)
@@ -467,7 +470,10 @@ def apply_sync_filters(
467470
[
468471
CriticalProcessingError(
469472
"Issue occurred while generating FeedbackMessages",
470-
[msg.error_message for msg in temp_messages],
473+
messages=[
474+
msg.error_message # type: ignore
475+
for msg in temp_messages
476+
],
471477
)
472478
],
473479
)
@@ -505,7 +511,9 @@ def apply_sync_filters(
505511
[
506512
CriticalProcessingError(
507513
"Issue occurred while filtering error records",
508-
[msg.error_message for msg in temp_messages],
514+
messages=[
515+
msg.error_message for msg in temp_messages # type: ignore
516+
],
509517
)
510518
],
511519
)
@@ -533,7 +541,10 @@ def apply_sync_filters(
533541
[
534542
CriticalProcessingError(
535543
"Issue occurred while generating FeedbackMessages",
536-
[msg.error_message for msg in temp_messages],
544+
messages=[
545+
msg.error_message # type: ignore
546+
for msg in temp_messages
547+
],
537548
)
538549
],
539550
)
@@ -592,7 +603,9 @@ def apply_rules(
592603
[
593604
CriticalProcessingError(
594605
"Issue occurred while applying pre filter steps",
595-
[msg.error_message for msg in stage_messages],
606+
messages=[
607+
msg.error_message for msg in stage_messages # type: ignore
608+
],
596609
)
597610
],
598611
)
@@ -644,7 +657,9 @@ def apply_rules(
644657
[
645658
CriticalProcessingError(
646659
"Issue occurred while applying post filter steps",
647-
[msg.error_message for msg in stage_messages],
660+
messages=[
661+
msg.error_message for msg in stage_messages # type: ignore
662+
],
648663
)
649664
],
650665
)

0 commit comments

Comments
 (0)