MuMoT
MuMoT copied to clipboard
Use of bare 'except:' is bad
Bare except: statements will swallow up all exceptions, making debugging more difficult and possibly making certain code paths inaccessible. For example in views.py line 2887 can never be reached as the except: lines above will consume any raised ZeroDivisionErrors.
2878 try:
2879 try:
2880 pyDScont['EQ' + str(EQ_iter)].backward()
2881 except:
2882 self._showErrorMessage('Continuation failure (backward) on initial branch<br>')
2883 try:
2884 pyDScont['EQ' + str(EQ_iter)].forward()
2885 except:
2886 self._showErrorMessage('Continuation failure (forward) on initial branch<br>')
2887 except ZeroDivisionError:
2888 self._show_computation_stop()
2889 self._showErrorMessage('Division by zero<br>')
Oh, and there are quite a few of these in the code - as of 65901dab48a963472d289287213f11e06473c9bf:
$ grep -R 'except:' mumot/ | wc -l
19