]> git.ipfire.org Git - thirdparty/patchwork.git/commit
trivial: Remove broad exceptions where possible
authorStephen Finucane <stephenfinucane@hotmail.com>
Thu, 8 Sep 2016 16:43:10 +0000 (17:43 +0100)
committerStephen Finucane <stephenfinucane@hotmail.com>
Sat, 24 Sep 2016 23:00:18 +0000 (00:00 +0100)
commit02cf4f511c1d0e45eca59263cf49838592f9e3bd
tree652cc6e87e022ac79506b83b6a6738b58fef7dc4
parentd848f046503dacc5423a840d483fe7e5edc07ca3
trivial: Remove broad exceptions where possible

The are two somewhat significant changes:

* The behavior of 'Bundle.add_patch' is changed. Previously this would
  raise an exception if the provided patch already existed in the
  bundle. Since this code was only used in one location, change this to
  return the BundlePatch if valid else None and change the calling code
  to check return value instead of catching the exception.
* Use a context manager to open the config file in pwclient. This loses
  a little granularity in error messaging, but this is a worthy
  compromise.

Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
patchwork/bin/pwclient
patchwork/models.py
patchwork/notifications.py
patchwork/paginator.py
patchwork/templatetags/listurl.py
patchwork/views/__init__.py
patchwork/views/bundle.py
patchwork/views/mail.py
patchwork/views/patch.py
patchwork/views/user.py
patchwork/views/xmlrpc.py