forked from SWISDATA/processintel
app: replace broad exception handling that hides errors #64
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#64
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: improvement (low to medium)
Where
app/__main__.py:41-44app/io_operations/export_operations.py:129-146app/mining_algorithms/inductive_mining_infrequent.py:277-304,:466-477app/ui/base_algorithm_ui/base_algorithm_controller.py:253-260app/ui/genetic_miner_ui/genetic_miner_controller.py:190-194app/ui/home_ui/home_controller.py:289-296,:313-322Problem
app/mining_algorithms/inductive_mining_infrequent.py:277-304except Exceptionaround the whole filtered cut detection. Any programming error is logged and the algorithm silently falls back to a flower model, so users get a "valid" but meaningless model.app/mining_algorithms/inductive_mining_infrequent.py:466-477_preserve_start_end_nodesguards withhasattrandexcept Exceptionand only logs at debug level. If it fails, the filtered DFG has no start/end nodes and the cuts are wrong without notice.app/io_operations/export_operations.py:129-146Exception(f"Failed …"), losing the type and traceback (raise … from eis missing), and leaks the temp file.app/ui/home_ui/home_controller.py:289-296,:313-322except Exceptionturns any failure into "auto-detect," or "no columns" without telling the user.app/ui/genetic_miner_ui/genetic_miner_controller.py:190-194app/__main__.py:41-44printed instead of logged, then ignored.app/ui/base_algorithm_ui/base_algorithm_controller.py:253-260Related: #8.
Fix
raise … from elogger.exceptionfrom
issues/CQ-002-broad-exception-handling-and-swallowed-errors.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The broad-catch and cleanup concerns are supported, but “losing the type and traceback because
raise ... from eis missing” is only partly correct. Raising a new exception insideexceptautomatically retains the original exception in__context__, and standard traceback rendering includes it. Reproduced the export wrapper with a missing temp-directory key: the newExceptionretains the originalAttributeErroras its context, although__cause__is unset. The top-level exception type is replaced and explicitfrom ewould express causality more clearly; the original traceback is not discarded. Temp-file leakage applies to failures after a file has been created, not every caught error.Code references: app/io_operations/export_operations.py:145, app/mining_algorithms/inductive_mining_infrequent.py:301.