aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/views.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-07-28 19:08:43 +0100
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-09-05 00:31:23 +0100
commitbea2db8464cacb42bfe168c8f0918f8de30fd2db (patch)
tree2ccf5638b95b8d6954a3d21829403ea5ad769a47 /layerindex/views.py
parent93ce26f21cdbbd8a645792359cde87acf05144d7 (diff)
downloadopenembedded-core-contrib-bea2db8464cacb42bfe168c8f0918f8de30fd2db.tar.gz
Show a coherent error on bulk change lock timeout
Since it's possible that the user will try to get patches while the update script is running, ensure we show a sensible error if the script times out waiting for a lock. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/views.py')
-rw-r--r--layerindex/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/layerindex/views.py b/layerindex/views.py
index f945044402..71524b3f3c 100644
--- a/layerindex/views.py
+++ b/layerindex/views.py
@@ -232,6 +232,10 @@ def bulk_change_patch_view(request, pk):
return response
return HttpResponse('No patch data generated', content_type='text/plain')
except Exception as e:
+ output = getattr(e, 'output', None)
+ if output:
+ if 'timeout' in output:
+ return HttpResponse('Failed to generate patches: timed out waiting for lock. Please try again shortly.', content_type='text/plain')
return HttpResponse('Failed to generate patches: %s' % e, content_type='text/plain')
# FIXME better error handling