Commit b309c80
committed
refactor: narrow overly broad except Exception catches to specific exception types
- base.py:137: Replace 'except Exception' with 'except (OSError, ImportError)' for filesystem initialization
- base.py:146: Replace 'except Exception' with 'except (OSError, json.JSONDecodeError)' for config loading
- sample_metadata.py:1867: Replace 'except Exception' with 'except (KeyError, NameError, SyntaxError, TypeError, AttributeError)' for pandas eval queries
- map_params.py:45: Replace 'except Exception' with 'except (ImportError, ModuleNotFoundError, AttributeError)' for basemap provider initialization
These changes prevent silent masking of unexpected bugs by only catching the specific exception types that each code block is designed to handle. Improves debuggability without altering intended error-handling behavior.
Fixes: Narrow overly broad exception handlers1 parent 49fcc68 commit b309c80
3 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1864 | 1864 | | |
1865 | 1865 | | |
1866 | 1866 | | |
1867 | | - | |
| 1867 | + | |
1868 | 1868 | | |
1869 | 1869 | | |
1870 | 1870 | | |
| |||
0 commit comments