Skip to content

Use of bare 'except:' is bad #387

@willfurnass

Description

@willfurnass

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>')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions