Replace bare except statement
Replace bare except with Exception and add a statement to log the
exception.
Issue: HIC-170
Change-Id: Ieaaff28b824d29e6ef14ebca5e4b97a97e3139be
diff --git a/crashreports/permissions.py b/crashreports/permissions.py
index e130cbf..0ff8ae8 100644
--- a/crashreports/permissions.py
+++ b/crashreports/permissions.py
@@ -1,4 +1,5 @@
"""Authorization permission classes for accessing the API."""
+import logging
from rest_framework.permissions import BasePermission
from crashreports.models import Device
@@ -16,7 +17,8 @@
"""
try:
device = Device.objects.get(user=user)
- except:
+ except Exception as exception: # pylint: disable=broad-except
+ logging.exception(exception)
return False
if uuid == device.uuid:
return True