autotest: Add logging for tko attributes upload error

BUG=chromium:869191
TEST=None

Change-Id: I98715497edbdc1dbd6fefd1dffe8477fade64e51
Reviewed-on: https://chromium-review.googlesource.com/1155983
Commit-Ready: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/tko/db.py b/tko/db.py
index 34c07eb..d8e2720 100644
--- a/tko/db.py
+++ b/tko/db.py
@@ -612,7 +612,11 @@
         for key, value in test.attributes.iteritems():
             data = {'test_idx': test_idx, 'attribute': key,
                     'value': value}
-            self.insert('tko_test_attributes', data, commit=commit)
+            try:
+                self.insert('tko_test_attributes', data, commit=commit)
+            except:
+                _log_error('Uploading attribute %r' % (data))
+                raise
 
         if not is_update:
             for label_index in test.labels: