diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-07-27 15:15:02 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-11 00:08:18 +0100 |
commit | 01891c13ae8dcba64e5cf79956f1b64c2afdaae3 (patch) | |
tree | 2994214402c9184baa1cd91ec383929e8e367532 /lib/toaster/orm | |
parent | 0990b4c73f194ec0be1762e4e48b1a525d8349fb (diff) | |
download | bitbake-contrib-01891c13ae8dcba64e5cf79956f1b64c2afdaae3.tar.gz |
toaster: fix unhandled exception
manage.py lsupdates throws DataError exception if the recipe can't be
saved to the MySQL database:
django.db.utils.DataError: (1406, "Data too long for column 'license' at row 1"
Adding DataError exception to the list of exceptions should make
lsupdates to print a warning message and skip the recipe.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'lib/toaster/orm')
-rw-r--r-- | lib/toaster/orm/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py index 3da9a66d0..1c9f3a936 100644 --- a/lib/toaster/orm/models.py +++ b/lib/toaster/orm/models.py @@ -21,7 +21,7 @@ from __future__ import unicode_literals -from django.db import models, IntegrityError +from django.db import models, IntegrityError, DataError from django.db.models import F, Q, Sum, Count from django.utils import timezone from django.utils.encoding import force_bytes @@ -78,7 +78,7 @@ if 'sqlite' in settings.DATABASES['default']['ENGINE']: try: obj = self.create(**params) return obj, True - except IntegrityError: + except (IntegrityError, DataError): exc_info = sys.exc_info() try: return self.get(**lookup), False |