From b8971d7d26f9537729d29725edd48aec84f6a4bc Mon Sep 17 00:00:00 2001 From: Devguru Date: Fri, 27 Feb 2026 14:00:57 +0530 Subject: [PATCH] fix: replace bare except with except Exception in osipi_fit_full_volume Replace bare 'except:' with 'except Exception as e:' in OsipiBase.osipi_fit_full_volume() (line 377). Before: bare except caught KeyboardInterrupt/SystemExit (cannot Ctrl+C) and silently swallowed all errors with no diagnostic output. After: only catches Exception subclasses, adds diagnostic print() showing error type and message for debuggability. No regressions: 1127 passed, 167 skipped, 22 xfailed, 6 xpassed. --- src/wrappers/OsipiBase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wrappers/OsipiBase.py b/src/wrappers/OsipiBase.py index 70dcb0f1..6ef67db4 100644 --- a/src/wrappers/OsipiBase.py +++ b/src/wrappers/OsipiBase.py @@ -374,10 +374,12 @@ def osipi_fit_full_volume(self, data, bvalues=None, **kwargs): return results - except: + except Exception as e: # Check if the problem is that full volume fitting is simply not supported in the standardized implementation if not hasattr(self, "ivim_fit_full_volume"): #and callable(getattr(self, "ivim_fit_full_volume")): print("Full volume fitting not supported for this algorithm") + else: + print(f"Full volume fitting failed: {type(e).__name__}: {e}") return False