Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates exception handling to use Django DatabaseError class #144

Merged
merged 1 commit into from
Oct 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -10,4 +10,3 @@ Pillow>=3.2
django>=1.8
freezegun>=0.3,<0.4
factory-boy==2.6.0
mysqlclient==1.3.7
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -47,6 +47,5 @@ def read_md(f): return open(f, 'r').read()
'Jinja2',
'autopep8',
'pytz',
'mysqlclient'
]
)
6 changes: 2 additions & 4 deletions silk/middleware.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import logging
import random

from MySQLdb import OperationalError

from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import transaction
from django.db import transaction, DatabaseError

from django.db.models.sql.compiler import SQLCompiler
from django.utils import timezone
@@ -133,7 +131,7 @@ def process_response(self, request, response):
while True:
try:
self._process_response(request, response)
except (AttributeError, OperationalError):
except (AttributeError, DatabaseError):
Logger.debug('Retrying _process_response')
self._process_response(request, response)
finally: