Skip to content

Commit 14afcb1

Browse files
Warn when no codes match the given filters
Using a default / hard coded value that isn't checked at runtime to send to Tyler, when triggered, will likely always result in an error from Tyler. This behavior will be removed at some point from the `efiling_integration.yml` files, but for now, log and send an error email whenever it does happen to make sure that affected interviews can fix themselves. Should print enough information (everything but the type of code) for developers to address it. Fixes #273.
1 parent c0583bf commit 14afcb1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

docassemble/EFSPIntegration/interview_logic.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,14 @@ def filter_codes(
458458
if len(codes) == 1:
459459
return codes, codes[0][0]
460460
elif len(codes) == 0:
461+
log_error_and_notify(
462+
f"Warning! No existing codes matched filters ({filters})! Falling back to default, but this is unchecked and dangerous. It will be removed in the future. (all of the options: {options})"
463+
)
461464
return list(options), default
462465
else:
466+
log(
467+
f"Warning! More than one code matched filters ({filters})! This can result in a worse UX for users. (the found options ({codes}))"
468+
)
463469
return codes, None
464470

465471

0 commit comments

Comments
 (0)